Skip to content

@epikodelabs/streamix


@epikodelabs/streamix / src/public-api / scope

Function: scope() ​

Creates a scope from either a config object or config factory.

Call Signature ​

scope<TConfig, TSetup>(definition, setup): ScopeWithSetup<ScopeReturnFromConfig<{ [K in string | number | symbol]: ({ readonly [K in string | number | symbol]: ScopePublicValue<ScopeResolvedValue<TConfig[K]>> } & { -readonly [K in string | number | symbol]: ScopePublicValue<ScopeResolvedValue<TConfig[K]>> })[K] }>, TSetup>

Defined in: projects/libraries/streamix/src/lib/atoms/scope.ts:817

Creates a scope from a config factory and optional setup extension.

Type Parameters ​

TConfig ​

TConfig extends Record<string, any>

TSetup ​

TSetup extends ScopeSetupResult

Parameters ​

definition ​

(this) => TConfig

setup ​

(self, scope) => TSetup

Returns ​

ScopeWithSetup<ScopeReturnFromConfig<{ [K in string | number | symbol]: ({ readonly [K in string | number | symbol]: ScopePublicValue<ScopeResolvedValue<TConfig[K]>> } & { -readonly [K in string | number | symbol]: ScopePublicValue<ScopeResolvedValue<TConfig[K]>> })[K] }>, TSetup>

Call Signature ​

scope<TConfig, TSetup>(definition, setup): ScopeWithSetup<ScopeReturnFromConfig<{ [K in string | number | symbol]: ({ readonly [K in string | number | symbol]: ScopePublicValue<ScopeResolvedValue<TConfig[K]>> } & { -readonly [K in string | number | symbol]: ScopePublicValue<ScopeResolvedValue<TConfig[K]>> })[K] }>, TSetup>

Defined in: projects/libraries/streamix/src/lib/atoms/scope.ts:828

Creates a scope from a plain object definition and optional setup extension.

Type Parameters ​

TConfig ​

TConfig extends Record<string, any>

TSetup ​

TSetup extends ScopeSetupResult

Parameters ​

definition ​

TConfig

setup ​

(self, scope) => TSetup

Returns ​

ScopeWithSetup<ScopeReturnFromConfig<{ [K in string | number | symbol]: ({ readonly [K in string | number | symbol]: ScopePublicValue<ScopeResolvedValue<TConfig[K]>> } & { -readonly [K in string | number | symbol]: ScopePublicValue<ScopeResolvedValue<TConfig[K]>> })[K] }>, TSetup>

Call Signature ​

scope<TConfig>(definition): ScopeReturnFromConfig<{ [K in string | number | symbol]: ({ readonly [K in string | number | symbol]: ScopePublicValue<ScopeResolvedValue<TConfig[K]>> } & { -readonly [K in string | number | symbol]: ScopePublicValue<ScopeResolvedValue<TConfig[K]>> })[K] }>

Defined in: projects/libraries/streamix/src/lib/atoms/scope.ts:839

Creates a scope from a config factory.

Type Parameters ​

TConfig ​

TConfig extends Record<string, any>

Parameters ​

definition ​

(this) => TConfig

Returns ​

ScopeReturnFromConfig<{ [K in string | number | symbol]: ({ readonly [K in string | number | symbol]: ScopePublicValue<ScopeResolvedValue<TConfig[K]>> } & { -readonly [K in string | number | symbol]: ScopePublicValue<ScopeResolvedValue<TConfig[K]>> })[K] }>

Call Signature ​

scope<TConfig>(definition): ScopeReturnFromConfig<{ [K in string | number | symbol]: ({ readonly [K in string | number | symbol]: ScopePublicValue<ScopeResolvedValue<TConfig[K]>> } & { -readonly [K in string | number | symbol]: ScopePublicValue<ScopeResolvedValue<TConfig[K]>> })[K] }>

Defined in: projects/libraries/streamix/src/lib/atoms/scope.ts:846

Creates a scope from a plain object definition.

Type Parameters ​

TConfig ​

TConfig extends Record<string, any>

Parameters ​

definition ​

TConfig

Returns ​

ScopeReturnFromConfig<{ [K in string | number | symbol]: ({ readonly [K in string | number | symbol]: ScopePublicValue<ScopeResolvedValue<TConfig[K]>> } & { -readonly [K in string | number | symbol]: ScopePublicValue<ScopeResolvedValue<TConfig[K]>> })[K] }>

Call Signature ​

scope<T, TSetup>(definition, setup): ScopeWithSetup<ScopeReturnFromConfig<{ [K in string | number | symbol]: UnwrapScopeValues<ScopeOf<T>>[K] }>, TSetup>

Defined in: projects/libraries/streamix/src/lib/atoms/scope.ts:853

Creates a scope with an explicit normalized state shape and setup extension.

Type Parameters ​

T ​

T extends Record<string, any>

TSetup ​

TSetup extends ScopeSetupResult

Parameters ​

definition ​

(this) => ScopeConfig<T>

setup ​

ScopeSetupCallback<ScopeSetupSelf<{ [K in string | number | symbol]: UnwrapScopeValues<ScopeOf<T>>[K] }>, ScopeReturnFromConfig<{ [K in string | number | symbol]: UnwrapScopeValues<ScopeOf<T>>[K] }>, TSetup>

Returns ​

ScopeWithSetup<ScopeReturnFromConfig<{ [K in string | number | symbol]: UnwrapScopeValues<ScopeOf<T>>[K] }>, TSetup>

Call Signature ​

scope<T>(definition): ScopeReturnFromConfig<{ [K in string | number | symbol]: UnwrapScopeValues<ScopeOf<T>>[K] }>

Defined in: projects/libraries/streamix/src/lib/atoms/scope.ts:865

Creates a scope with an explicit normalized state shape.

Type Parameters ​

T ​

T extends Record<string, any>

Parameters ​

definition ​

(this) => ScopeConfig<T>

Returns ​

ScopeReturnFromConfig<{ [K in string | number | symbol]: UnwrapScopeValues<ScopeOf<T>>[K] }>

Call Signature ​

scope<T, TSetup>(definition, setup): ScopeWithSetup<ScopeReturnFromConfig<{ [K in string | number | symbol]: UnwrapScopeValues<ScopeOf<T>>[K] }>, TSetup>

Defined in: projects/libraries/streamix/src/lib/atoms/scope.ts:872

Creates a scope with an explicit normalized state shape from an object definition and setup extension.

Type Parameters ​

T ​

T extends Record<string, any>

TSetup ​

TSetup extends ScopeSetupResult

Parameters ​

definition ​

ScopeConfig<T>

setup ​

ScopeSetupCallback<ScopeSetupSelf<{ [K in string | number | symbol]: UnwrapScopeValues<ScopeOf<T>>[K] }>, ScopeReturnFromConfig<{ [K in string | number | symbol]: UnwrapScopeValues<ScopeOf<T>>[K] }>, TSetup>

Returns ​

ScopeWithSetup<ScopeReturnFromConfig<{ [K in string | number | symbol]: UnwrapScopeValues<ScopeOf<T>>[K] }>, TSetup>

Call Signature ​

scope<T>(definition): ScopeReturnFromConfig<{ [K in string | number | symbol]: UnwrapScopeValues<ScopeOf<T>>[K] }>

Defined in: projects/libraries/streamix/src/lib/atoms/scope.ts:884

Creates a scope with an explicit normalized state shape from an object definition.

Type Parameters ​

T ​

T extends Record<string, any>

Parameters ​

definition ​

ScopeConfig<T>

Returns ​

ScopeReturnFromConfig<{ [K in string | number | symbol]: UnwrapScopeValues<ScopeOf<T>>[K] }>

Released under the MIT License.