跳转到内容

快速开始

Terminal window
npm install fatigue-kit
import { createFatigue } from 'fatigue-kit'
import { localStorageAdapter } from 'fatigue-kit/adapters/local-storage'
const fatigue = createFatigue({ storage: localStorageAdapter() })
const result = fatigue.tryConsume('onboarding-guide', [
{ max: 1, every: 'day' },
{ cooldown: '4h' },
])
if (result.allowed) showOnboardingGuide()

使用 peek 只读检查,使用 reset、exportRecord 和 importRecord 运维或调试。