Home > @uniformdev/canvas > createUniformApiEnhancer

createUniformApiEnhancer() function

Creates an enhancer based on an API route. This is mainly used to create an enhancer for Contextual Editing, which can be passed to the contextualEditingEnhancer prop of <UniformComposition />.

Signature:

Parameters

ParameterTypeDescription
{ apiUrl }{ apiUrl: string; }

Returns:

(message: Pick<UpdateCompositionMessage, "composition" | "hash">) => Promise<{ type: string; parameters?: { [key: string]: components$m["schemas"]["ComponentParameter"]; }; variant?: string; projectMapNodes?: components$m["schemas"]["CompositionProjectMapNodeInfo"][]; slots?: { [key: string]: components$m["schemas"]["ComponentInstance"][]; }; _id: string; _slug?: string | null; _name: string; _author?: string; _authorSubject?: string; _creator?: string; _creatorSubject?: string; _pattern?: string; _patternDataResources?: { [key: string]: components$m["schemas"]["DataResourceDefinition"]; }; _dataResources?: components$m["schemas"]["DataResourceDefinitions"]; _patternError?: components$m["schemas"]["PatternError"]; _overrides?: { [key: string]: components$m["schemas"]["ComponentOverride"]; }; _overridability?: components$m["schemas"]["ComponentOverridability"]; _locales?: string[]; }>

Example