Skip to content

Function: applySharedSeed()

ts
function applySharedSeed(container: Container, seed: AnyObject): void;

Defined in: src/wirestate-core/seeds/apply-shared-seed.ts:32

Replaces the shared seed object.

Parameters

ParameterTypeDescription
containerContainerContainer to update.
seedAnyObjectNew shared seed object.

Returns

void

Remarks

A container has one shared seed. Use it for app-wide config: locale, feature flags, API base URL. Targeted seeds live in a separate map.

Example

typescript
import { SEED, applySharedSeed, createContainer } from "@wirestate/core";

const container = createContainer({ seed: { locale: "en-US" } });

applySharedSeed(container, { locale: "uk-UA" });

const seed = container.get<{ locale: string }>(SEED);