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

Function createMessage

packages/core/src/store.ts:146–163  ·  view source on GitHub ↗
(
  conf: Partial<FormKitMessage>,
  node?: FormKitNode
)

Source from the content-addressed store, hash-verified

144 * @public
145 */
146export function createMessage(
147 conf: Partial<FormKitMessage>,
148 node?: FormKitNode
149): FormKitMessageProps {
150 const m = {
151 blocking: false,
152 key: token(),
153 meta: {} as FormKitMessageMeta,
154 type: 'state',
155 visible: true,
156 ...conf,
157 }
158 if (node && m.value && m.meta.localize !== false) {
159 m.value = node.t(m as FormKitTextFragment)
160 m.meta.locale = node.config.locale
161 }
162 return m
163}
164
165/**
166 * The available traps on the node's store.

Callers 15

reactBindingsFunction · 0.90
useInputFunction · 0.90
i18n.spec.tsFile · 0.90
events.spec.tsFile · 0.90
lists.spec.tsFile · 0.90
store.spec.tsFile · 0.90
ledger.spec.tsFile · 0.90
errorFunction · 0.90
valErrFunction · 0.90
validation.tsFile · 0.90
validateFunction · 0.90
createFailedMessageFunction · 0.90

Calls 1

tokenFunction · 0.90

Tested by 2

errorFunction · 0.72
valErrFunction · 0.72