* 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 )
| 1944 | * @internal |
| 1945 | */ |
| 1946 | function 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 |