signl

Signals proposal, but using Vue API!

MIT License

Downloads
10
Stars
11
Committers
1

Signl

This project is a basic implementation of TC39 signals proposal, using the @vue/reactivity package.

Installation

npm install signl

Usage

A counter app

import { Signal, effect } from 'signl';

const counter = new Signal.State(0);
const isEven = new Signal.Computed(() => (counter.get() & 1) == 0);
const parity = new Signal.Computed(() => isEven.get() ? 'even' : 'odd');

effect(() => element.innerText = parity.get())

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

License

MIT