Method

type Method = () => unknown;

Is a Function which is mounted as JavaScript method of the class Model.

Warning

Do not use Arrow Functions to not override the this argument provided by the scope.

Methods

type Methods = { [key: string]: Method };

Specifies the JavaScript methods of the class Model. It is an Object where each key is the name of the method and the relative value is a Function which is the body of the method.

Note

Some methods, when provided, are called by Sedentary at specific events. Please check Special methods for more details.

ModelOptions.init

  • default: undefined

If provided, it works as the constructor Function does. It will be called when a new Model() is created.

Note

TODO It is not called for loaded Entries.