docs: showcase atom functions

This commit is contained in:
Richard 2024-03-25 02:22:55 -07:00
parent fe55171432
commit 5e592cecdd

View file

@ -89,7 +89,7 @@ Charm = "littensy/charm@VERSION"
import { atom, derive, subscribe } from "@rbxts/charm"; import { atom, derive, subscribe } from "@rbxts/charm";
const counterAtom = atom(0); const counterAtom = atom(0);
const doubleCounterAtom = derive(() => counterAtom() * 2); const doubleCounterAtom = () => counterAtom() * 2;
subscribe(doubleCounterAtom, (value) => { subscribe(doubleCounterAtom, (value) => {
print(value); print(value);