Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/07akioni/sstimer
A super simple timer that can start, stop & fire finish callback.
https://github.com/07akioni/sstimer
Last synced: 28 days ago
JSON representation
A super simple timer that can start, stop & fire finish callback.
- Host: GitHub
- URL: https://github.com/07akioni/sstimer
- Owner: 07akioni
- Created: 2022-08-04T11:58:02.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-08-04T12:01:31.000Z (over 2 years ago)
- Last Synced: 2024-11-24T16:26:02.251Z (about 1 month ago)
- Language: TypeScript
- Size: 1.95 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# sstimer
## Usage
```js
import { createTimer } from "sstimer";const timer = createTimer(
() => {
alert("Stop");
},
{
duration: 5000,
}
);document.querySelector("button")?.addEventListener("click", () => {
if (timer.active) {
timer.stop();
} else {
timer.start();
}
});
```