Security News
Introducing the Socket Python SDK
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
@reatom/timer
Advanced tools
Timer model to manage some countdown. Useful for classic pomodoro or any time-progress states, like notifications.
import { reatomTimer } from '@reatom/timer'
// all options are not required, here are the defaults
const pomodoroAtom = reatomTimer({
name: 'pomodoroAtom',
interval: 1000, // `1000`ms - tick each second. Than lower, then more precise
delayMultiplier: 1000, // `1000`ms allow to pass seconds to startTimer. Use `1` to pass ms
progressPrecision: 2, // progress will be rounded to 2 digits after dot
resetProgress: true, // progress will be reset to 0 on end of timer
})
The timer itself contains the ms remaining to the end of the timer (0
before start). Here is the list of available states and methods:
Atom<number>
) - from 0 to 1, (delay - remains) / delay
AtomMut<number>
) - interval of ticks in msAction<[delay: number, passed?: number], Promise<void>>
) - start timer with the delay and optional start pointAction<[], void>
) - stop timer manuallyAtomMut<boolean>
) - allow to pause timerAction<[], boolean>
) - switch pause stateAction<[], void>
) - track end of timer. Do not call manually!FAQs
Reatom for timers
The npm package @reatom/timer receives a total of 160 weekly downloads. As such, @reatom/timer popularity was classified as not popular.
We found that @reatom/timer demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
Security News
Floating dependency ranges in npm can introduce instability and security risks into your project by allowing unverified or incompatible versions to be installed automatically, leading to unpredictable behavior and potential conflicts.
Security News
A new Rust RFC proposes "Trusted Publishing" for Crates.io, introducing short-lived access tokens via OIDC to improve security and reduce risks associated with long-lived API tokens.