MCPcopy
hub / github.com/rx-angular/rx-angular / setupState

Function setupState

libs/state/spec/fixtures.ts:4–11  ·  view source on GitHub ↗
(cfg: { initialState?: T })

Source from the content-addressed store, hash-verified

2import { RxState } from '../src/lib/rx-state.service';
3
4export function setupState<T extends object>(cfg: { initialState?: T }) {
5 const { initialState } = { ...cfg };
6 const state = new RxState<T>();
7 if (initialState) {
8 state.set(initialState);
9 }
10 return state;
11}
12
13type ProjectStateFn<T> = (state: T) => any;
14

Callers

nothing calls this directly

Calls 1

setMethod · 0.95

Tested by

no test coverage detected