MCPcopy Index your code
hub / github.com/tinyplex/tinybase / addAllowValueMutator

Function addAllowValueMutator

test/unit/core/store/store-schema.test.ts:40–53  ·  view source on GitHub ↗
(
  store: Store<any>,
  valueId: Id,
  values: V[],
)

Source from the content-addressed store, hash-verified

38 );
39
40const addAllowValueMutator = <V extends Value<any, any, any>>(
41 store: Store<any>,
42 valueId: Id,
43 values: V[],
44): Id =>
45 store.addValueListener(
46 valueId,
47 (store, ..._) => {
48 if (!values.includes(store.getValue(valueId) as V)) {
49 store.delValue(valueId);
50 }
51 },
52 true,
53 );
54
55const getAddMinMaxMutator =
56 (

Callers 1

Calls 3

addValueListenerMethod · 0.65
getValueMethod · 0.65
delValueMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…