mirror of
https://github.com/littensy/charm.git
synced 2026-10-22 21:01:38 +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.
|
||||
*/
|
||||
type Molecule<State> = () => State;
|
||||
type Molecule<State> = (...args: any[]) => State;
|
||||
|
||||
/**
|
||||
* 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.
|
||||
@return The current state.
|
||||
]=]
|
||||
export type Molecule<T> = () -> T
|
||||
export type Molecule<T> = (...any) -> T
|
||||
|
||||
--[=[
|
||||
Optional configuration for creating an atom.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue