mirror of
https://github.com/littensy/charm.git
synced 2026-10-23 05:46:27 +00:00
feat: support multiple arguments for molecule
This commit is contained in:
parent
d202268d3f
commit
09f684209c
2 changed files with 2 additions and 2 deletions
2
src/index.d.ts
vendored
2
src/index.d.ts
vendored
|
|
@ -35,7 +35,7 @@ declare namespace Charm {
|
||||||
*
|
*
|
||||||
* @returns The current state.
|
* @returns The current state.
|
||||||
*/
|
*/
|
||||||
type Molecule<State> = () => State;
|
type Molecule<State> = (...args: any[]) => State;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Infers the type of the state produced by the given molecule.
|
* Infers the type of the state produced by the given molecule.
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ export type Atom<T> = (() -> T) & (state: T | (T) -> T) -> T
|
||||||
@template State The type of the state.
|
@template State The type of the state.
|
||||||
@return The current state.
|
@return The current state.
|
||||||
]=]
|
]=]
|
||||||
export type Molecule<T> = () -> T
|
export type Molecule<T> = (...any) -> T
|
||||||
|
|
||||||
--[=[
|
--[=[
|
||||||
Optional configuration for creating an atom.
|
Optional configuration for creating an atom.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue