Skip to content

Latest commit

 

History

History
22 lines (14 loc) · 462 Bytes

README.md

File metadata and controls

22 lines (14 loc) · 462 Bytes

alien-signals-starter

Use the createReactiveSystem API to build a simple signal library.

Usage

import { signal, computed, effect } from 'alien-signals-starter';

const count = signal(1);
const doubleCount = computed(() => count.get() * 2);

effect(() => {
  console.log(`Count is: ${count.get()}`);
}); // Console: Count is: 1

console.log(doubleCount.get()); // 2

count.set(2); // Console: Count is: 2

console.log(doubleCount.get()); // 4