MCPcopy Create free account
hub / github.com/EvoMap/evolver / makeStore

Function makeStore

test/lifecycleStaleNodeSecret.test.js:46–60  ·  view source on GitHub ↗
(initial = {})

Source from the content-addressed store, hash-verified

44}
45
46function makeStore(initial = {}) {
47 const state = { ...initial };
48 const inbound = [];
49 const sets = [];
50 return {
51 getState: (k) => (state[k] !== undefined ? state[k] : null),
52 setState: (k, v) => { state[k] = v; sets.push([k, v]); },
53 countPending: () => 0,
54 writeInbound: (event) => { inbound.push(event); },
55 writeInboundBatch: () => {},
56 _state: state,
57 _inbound: inbound,
58 _sets: sets,
59 };
60}
61
62function silentLogger() {
63 const calls = { log: [], warn: [], error: [] };

Calls

no outgoing calls

Tested by

no test coverage detected