-
Notifications
You must be signed in to change notification settings - Fork 7
feat: add setAtom bound to the state manager #57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,17 +20,6 @@ export type MakeComputed = < | |
|
||
export type MutatorArgs = Array<unknown>; | ||
|
||
export type MakeUpdate = < | ||
SignalSubType extends Signal<unknown>, | ||
SignalsToMutate extends Record<string, SignalSubType>, | ||
Values extends { | ||
[SignalName in keyof SignalsToMutate]?: UnwrapSignal<SignalsToMutate[SignalName]>; | ||
}, | ||
>( | ||
signalsToMutate: SignalsToMutate, | ||
mutator: (signalValues: Values, ...mutatorArgs: MutatorArgs) => Values, | ||
) => (...mutatorArgs: MutatorArgs) => void; | ||
|
||
export type MakeContextHook<T> = <StateDef extends () => Signal<T>>( | ||
stateDef: StateDef, | ||
) => Signal<T>; | ||
|
@@ -50,7 +39,7 @@ export type DefineState = < | |
defineStateCb: ( | ||
atom: MakeAtom, | ||
computed: MakeComputed, | ||
update: MakeUpdate, | ||
fromContext: MakeContextHook<ContextShape>, | ||
setAtom: <T>(a: Signal<T>, newValue: T) => void, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd like to rethink the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. sure thing, let's brainstorm on it! |
||
) => (...args: Args) => InnerStateShape, | ||
) => (...args: Args) => Signal<OuterStateShape>; |
Uh oh!
There was an error while loading. Please reload this page.