Variable IdConst

Id: {
    clearAllIds: (() => void);
    createId: ((proposedId) => string);
    removeId: ((id) => boolean);
} = ...

Mutable registry of the ID generation functions used internally by JSON Forms.

Adopters can override one or more of these methods to provide a custom HTML ID strategy (e.g. for performance reasons or to integrate with an existing scheme). Reassigning the methods only affects callers that go through this object; the standalone createId, removeId and clearAllIds exports always invoke the default implementations.

Type declaration

  • clearAllIds: (() => void)
      • (): void
      • Returns void

  • createId: ((proposedId) => string)
      • (proposedId): string
      • Parameters

        • proposedId: string

        Returns string

  • removeId: ((id) => boolean)
      • (id): boolean
      • Parameters

        • id: string

        Returns boolean

Example

import { Id } from '@jsonforms/core';

let next = 0;
Id.createId = () => `jf-${next++}`;
Id.removeId = () => true;
Id.clearAllIds = () => {
next = 0;
};