From 09f684209c583e8bb235c74757a77c32d6c17bdd Mon Sep 17 00:00:00 2001 From: NormalDuck <1juhuang2@duck.com> Date: Thu, 29 Aug 2024 16:37:44 -0700 Subject: [PATCH] feat: support multiple arguments for molecule --- src/index.d.ts | 2 +- src/types.luau | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/index.d.ts b/src/index.d.ts index 4bbbd31..335cf93 100644 --- a/src/index.d.ts +++ b/src/index.d.ts @@ -35,7 +35,7 @@ declare namespace Charm { * * @returns The current state. */ - type Molecule = () => State; + type Molecule = (...args: any[]) => State; /** * Infers the type of the state produced by the given molecule. diff --git a/src/types.luau b/src/types.luau index 16d19f2..43795f9 100644 --- a/src/types.luau +++ b/src/types.luau @@ -18,7 +18,7 @@ export type Atom = (() -> T) & (state: T | (T) -> T) -> T @template State The type of the state. @return The current state. ]=] -export type Molecule = () -> T +export type Molecule = (...any) -> T --[=[ Optional configuration for creating an atom.