signal-effect
TypeScript icon, indicating that this package has built-in type declarations

0.0.5 • Public • Published

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);

Dependencies (0)

    Dev Dependencies (13)

    Package Sidebar

    Install

    npm i signal-effect

    Weekly Downloads

    127

    Version

    0.0.5

    License

    MIT

    Unpacked Size

    3.59 kB

    Total Files

    3

    Last publish

    Collaborators

    • tzachb