Socket
Book a DemoInstallSign in
Socket

signal-effect

Package Overview
Dependencies
Maintainers
0
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

signal-effect

Simple effect() method based on the tc39/proposal-signals

latest
Source
npmnpm
Version
0.0.5
Version published
Maintainers
0
Created
Source

signal-effect)

Signal Effect

Simple effect(() => {}) method based on the tc39/proposal-signals

Disclaimer: It uses "signal-polyfill" until the proposal is accepted and implemented in the browsers.

Install

npm install --save signal-effect signal-polyfill

Usage

// polyfill for signal
import { Signal } from 'signal-polyfill';

import { effect } from 'signal-effect';

const counter = new Signal.State(0);

effect(() => (element.innerText = counter.get()));

// Simulate external updates to counter...
setInterval(() => counter.set(counter.get() + 1), 1000);

Keywords

signal

FAQs

Package last updated on 12 Sep 2024

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