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

Function createPlaceholder

packages/core/src/node.ts:3362–3383  ·  view source on GitHub ↗
(
  options?: FormKitOptions & { name?: string }
)

Source from the content-addressed store, hash-verified

3360 * @internal
3361 */
3362export function createPlaceholder(
3363 options?: FormKitOptions & { name?: string }
3364): FormKitPlaceholderNode {
3365 return {
3366 __FKP: true,
3367 uid: Symbol(),
3368 name: options?.name ?? `p_${nameCount++}`,
3369 value: options?.value ?? null,
3370 _value: options?.value ?? null,
3371 type: options?.type ?? 'input',
3372 props: {},
3373 use: () => {
3374 // noop
3375 },
3376 input(value: unknown) {
3377 this._value = value
3378 this.value = value
3379 return Promise.resolve()
3380 },
3381 isSettled: true,
3382 }
3383}
3384
3385/**
3386 * Determines if a node is a placeholder node.

Callers 2

lists.spec.tsFile · 0.90
syncListNodesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected