MCPcopy
hub / github.com/tinyplex/tinybase / setValue

Function setValue

src/store/index.ts:1702–1717  ·  view source on GitHub ↗
(
    valueId: Id,
    value: Value,
    skipMiddleware?: boolean,
  )

Source from the content-addressed store, hash-verified

1700 );
1701
1702 const setValue = (
1703 valueId: Id,
1704 value: Value,
1705 skipMiddleware?: boolean,
1706 ): Store =>
1707 fluentTransaction(
1708 (valueId) =>
1709 ifNotUndefined(
1710 getValidatedValue(
1711 valueId,
1712 isFunction(value) ? value(getValue(valueId)) : value,
1713 ),
1714 (validValue) => setValidValue(valueId, validValue, skipMiddleware),
1715 ),
1716 valueId,
1717 );
1718
1719 const applyChanges = (changes: Changes): Store =>
1720 fluentTransaction(() =>

Callers 4

setOrDelValueFunction · 0.70
StateFunction · 0.50
TestFunction · 0.50
StateFunction · 0.50

Calls 5

isFunctionFunction · 0.90
fluentTransactionFunction · 0.70
getValidatedValueFunction · 0.70
getValueFunction · 0.70
setValidValueFunction · 0.70

Tested by 3

StateFunction · 0.40
TestFunction · 0.40
StateFunction · 0.40

Used in the wild real call sites across dependent graphs

searching dependent graphs…