feat: support multiple arguments for molecule

This commit is contained in:
NormalDuck 2024-08-29 16:37:44 -07:00
parent d202268d3f
commit 09f684209c
2 changed files with 2 additions and 2 deletions

2
src/index.d.ts vendored
View file

@ -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.

View file

@ -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.