MCPcopy Create free account
hub / github.com/formkit/formkit / commit

Function commit

packages/core/src/node.ts:1946–1957  ·  view source on GitHub ↗

* Commits the working value to the node graph as the value of this node. * * @param node - A FormKitNode | FormKitNode * @param context - A FormKitContext | FormKitContext * @param calm - If it calms the node * @param hydrate - If it hydrates the node * * @internal

(
  node: FormKitNode,
  context: FormKitContext,
  calm = true,
  hydrate = true
)

Source from the content-addressed store, hash-verified

1944 * @internal
1945 */
1946function commit(
1947 node: FormKitNode,
1948 context: FormKitContext,
1949 calm = true,
1950 hydrate = true
1951) {
1952 context._value = context.value = node.hook.commit.dispatch(context._value)
1953 if (node.type !== 'input' && hydrate) node.hydrate()
1954 node.emit('commitRaw', context.value)
1955 node.emit('commit', context.value)
1956 if (calm) node.calm()
1957}
1958
1959/**
1960 * Perform a modification to a single element of a parent aggregate value. This

Callers 3

inputFunction · 0.85
calmFunction · 0.85
addChildFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected