Skip to content

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

CrelteRequest

Returns

void | Promise<void>


loadGlobalData()?

ts
optional loadGlobalData: (cr) => void | Promise<void>;

This will be called during the loadGlobalData phase.

Parameters

cr

CrelteRequest

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

CrelteRequest

route

Route

Returns

void


toRequest()?

ts
optional toRequest: (req) => Plugin;

The returned value will be used inside of CrelteRequest

Parameters

req

Request

Returns

Plugin