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, options?): 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:814

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

options?

ScopeOptions

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, options?): 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:826

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

options?

ScopeOptions

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, options?): 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:838

Creates a scope from a config factory.

Type Parameters

TConfig

TConfig extends Record<string, any>

Parameters

definition

(this) => TConfig

options?

ScopeOptions

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, options?): 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

options?

ScopeOptions

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, options?): ScopeWithSetup<ScopeReturnFromConfig<{ [K in string | number | symbol]: UnwrapScopeValues<ScopeOf<T>>[K] }>, TSetup>

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

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>

options?

ScopeOptions

Returns

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

Call Signature

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

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

Creates a scope with an explicit normalized state shape.

Type Parameters

T

T extends Record<string, any>

Parameters

definition

(this) => ScopeConfig<T>

options?

ScopeOptions

Returns

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

Call Signature

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

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

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>

options?

ScopeOptions

Returns

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

Call Signature

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

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

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>

options?

ScopeOptions

Returns

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

Released under the GNU AGPL v3 or later.