crelte / plugins / Plugin
Interface: Plugin
A plugin
Properties
loadData()?
ts
optional loadData: (cr) => void | Promise<void>;This will be called during the loadData phase.
Parameters
cr
Returns
void | Promise<void>
loadGlobalData()?
ts
optional loadGlobalData: (cr) => void | Promise<void>;This will be called during the loadGlobalData phase.
Parameters
cr
Returns
void | Promise<void>
name
ts
name: string;render()?
ts
optional render: (cr, route) => void;This will be called before the dom gets updated.
At this point you can update variables or stores.
Parameters
cr
route
Returns
void
toRequest()?
ts
optional toRequest: (req) => Plugin;The returned value will be used inside of CrelteRequest
Parameters
req
Returns
Plugin