Skip to content

Function: unapplySeeds()

ts
function unapplySeeds(container: Container, seeds: SeedEntries): void;

Defined in: src/wirestate-core/seeds/unapply-seeds.ts:34

Removes targeted seed values from a container.

Parameters

ParameterTypeDescription
containerContainerContainer to update.
seedsSeedEntriesSeed entries whose keys should be removed.

Returns

void

Remarks

This removes by key. The seed values in seeds are ignored.

Example

typescript
import { Injectable, createContainer, unapplySeeds } from "@wirestate/core";

@Injectable()
class CounterService {}

const container = createContainer({
  seeds: [[CounterService, { count: 10 }]],
});

unapplySeeds(container, [[CounterService, { count: 10 }]]);