mirror of
https://github.com/littensy/charm.git
synced 2026-10-23 22:21:37 +00:00
feat: add batch()
This commit is contained in:
parent
8a0d0977ca
commit
f0a7938703
13 changed files with 112 additions and 52 deletions
6
src/index.d.ts
vendored
6
src/index.d.ts
vendored
|
|
@ -28,12 +28,14 @@ declare namespace Charm {
|
|||
|
||||
function subscribe<State>(molecule: Molecule<State>, callback: (state: State, prev: State) => void): Cleanup;
|
||||
|
||||
function effect(callback: Molecule<void>): Cleanup;
|
||||
function effect(callback: () => void): Cleanup;
|
||||
|
||||
function unwrap<State>(molecule: State | Molecule<State>): State;
|
||||
function unwrap<State, Args extends unknown[]>(molecule: State | ((...args: Args) => State), ...args: Args): State;
|
||||
|
||||
function capture<State>(molecule: Molecule<State>): LuaTuple<[captured: Set<Atom<unknown>>, state: State]>;
|
||||
|
||||
function batch(callback: () => void): void;
|
||||
|
||||
function observe<Item>(
|
||||
molecule: Molecule<readonly Item[]>,
|
||||
factory: (item: Item, index: number) => Cleanup | void,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue