7 lines
184 B
TypeScript
7 lines
184 B
TypeScript
import { nanoid } from 'nanoid';
|
|
|
|
/** Stable element id for editor-inserted elements. */
|
|
export function createElementId(prefix: string): string {
|
|
return `${prefix}-${nanoid(8)}`;
|
|
}
|