Skip to main content

Class: Synergy<T>

Type parameters

NameType
Textends any[] = any[]

Hierarchy

Constructors

constructor

new Synergy<T>(atoms)

Type parameters

NameType
Textends any[] = any[]

Parameters

NameType
atomsany

Defined in

synergy.ts:19

Properties

atoms

Readonly atoms: AtomTuple<T>

Defined in

synergy.ts:17

Methods

combine

combine<R>(...otherSynergies): Synergy<[...T[], ...Flatten<R, []>[]]>

Type parameters

NameType
Rextends any[]

Parameters

NameType
...otherSynergiesSynergyTuple<R>

Returns

Synergy<[...T[], ...Flatten<R, []>[]]>

Defined in

synergy.ts:29


createAction

createAction<A>(handler): () => (...args: A) => Promise<void>

Type parameters

NameType
Aextends any[]

Parameters

NameType
handler(...args: A) => (...drafts: DraftTuple<T>) => void | Promise<void>

Returns

fn

▸ (): (...args: A) => Promise<void>

Returns

fn

▸ (...args): Promise<void>

Parameters
NameType
...argsA
Returns

Promise<void>

Defined in

synergy.ts:54


createProviderState

createProviderState(initialState?): Record<symbol, AtomContextData<T[number]>>

internal

Parameters

NameType
initialState?Record<symbol, any>

Returns

Record<symbol, AtomContextData<T[number]>>

Defined in

synergy.ts:102


createSelector

createSelector<R>(selectorFn): () => any

Type parameters

Name
R

Parameters

NameType
selectorFn(...args: T) => R

Returns

fn

▸ (): any

Returns

any

Defined in

synergy.ts:37


useSet

useSet(): (...args: T) => Promise<void>

Returns

fn

▸ (...args): Promise<void>

Parameters
NameType
...argsT
Returns

Promise<void>

Defined in

synergy.ts:119


useValue

useValue(): any

Returns

any

Defined in

synergy.ts:115