1.1.0 • Published 2 years ago
@sazed/streak-counter v1.1.0
@sazed/streak-counter
- a basic streak counter
This is a basic streak counter - inspired by Duolingo,
and made following Joe Previte's course -
written in TypeScript and meant for the browser (uses localStorage
).
Install
yarn add @sazed/streak-counter
Usage
import { streakCounter } from '@sazed/streak-counter';
const today = new Date();
const streak = streakCounter(localStorage, today);
streak returns an object:
{
currentCount: 1,
lastLoginDate: "01/24/2023",
startDate: "01/24/2023",
}