Skip to main content

Function: decoratedModel()

function decoratedModel<M, MC>(
name,
clazz,
decorators
): MC;

Marks a class (which MUST inherit from the Model abstract class) as a model and decorates some of its methods/properties.

Type Parameters​

Type Parameter
M
MC extends (...ags) => M

Parameters​

ParameterTypeDescription
namestring | undefinedUnique name for the model type. Note that this name must be unique for your whole application, so it is usually a good idea to use some prefix unique to your application domain. If you don't want to assign a name yet (e.g. for a base model) pass undefined.
clazzMCModel class.
decorators{ [k in string | number | symbol]?: AnyFunction | readonly AnyFunction[] }Decorators.

Returns​

MC