open-index/open-npm huggingface dataset:
npm package: @marekdano/streak-counter
Description: Learn TS by Joe Previte's newsletter
Author: Marek Dano
Latest version: 0.0.1

# streak-couter
Learn TS by Joe Previte's newsletter

# `@marekdano/streak-counter` - a basic streak counter

This is a basic streak counter - inspired by Duolingo - written in TypeScript and meant for the browser (uses `localStorage`).

## Install

yarn add @marekdano/streak-counter

npm install @marekdano/streak-counter

## Usage
```js
import {streakCounter} from '@marekdano/streak-counter'

const today = new Date()
const streak = streakCounter(localStorage, today)
// streak returns an object:
// {
//    currentCount: 1,
//    lastLoginDate: "11/11/2021",
//    startDate: "11/11/2021",
// }
```
npm package: @marekdano/use-quote
Description: a custom React hook that provides a random quote from QuoteGarden
Author: marekdano
Latest version: 1.0.0

# @marekdano/use-quote

> A custom React hook that provides a random quote from QuoteGarden

[![NPM](https://img.shields.io/npm/v/@marekdano/use-quote.svg)](https://www.npmjs.com/package/@marekdano/use-quote) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)

## Install

```bash
npm install --save @marekdano/use-quote
```
OR

```bash
yarn add @marekdano/use-quote
```

## Usage

```jsx
import React, { Component } from 'react'

import { useQuote } from '@marekdano/use-quote'

const Example = () => {
  const { quote, isLoading, isError } = useQuote()
  
  if (isLoading) return <p>Loading...</p>

  if (quote) {
    return (
      <>
        <p>{quote.text}</p>
        <p><i>{quote.author}</i></p>
      </>
    )
  }

  if (isError) return <p>Difficulty displaying a quote at the moment.</p>

  return null
}
```

## License

MIT © [marekdano](https://github.com/marekdano)

---

This hook is created using [create-react-hook](https://github.com/hermanya/create-react-hook).