🚀 Launch Week Day 4:Introducing the Alert Details Page: A Better Way to Explore Alerts.Learn More →
Socket
Book a DemoInstallSign in
Socket

@solid-primitives/timer

Package Overview
Dependencies
Maintainers
2
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@solid-primitives/timer

Primitive to manage timeout and interval

Source
npmnpm
Version
1.0.2
Version published
Weekly downloads
26K
-28.62%
Maintainers
2
Weekly downloads
 
Created
Source

Name: timer Stage: 3 Package: "@solid-primitives/timer" Primitives: createTimer

@solid-primitives/timer

lerna size size

A timer wrapper to handle setTimeout and setInterval.

createTimer - A single timer that can handle timeouts and intervals.

How to use it

let [count, setCount] = createSignal(0);
createTimer(() => setCount(count() + 1), 500, Schedule.Interval);
<h1>Counting up: {count()}</h1>;

Demo

You may view a working example here: https://codesandbox.io/s/solid-primitives-timer-6n7dt?file=/src/index.tsx

Changelog

Expand Changelog

0.0.100

First commit of the timer primitive.

0.0.107

Patched an issue with clear on clean-up.

1.0.2

Release official version with CJS support.

Keywords

setInterval

FAQs

Package last updated on 28 Nov 2021

Did you know?

Socket

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.

Install

Related posts