Skip to main content

TemplatesStore

@quik/templates


@quik/templates / TemplatesStore

Variable: TemplatesStore

const TemplatesStore: object

Defined in: templates/src/stores/templates.ts:82

API for loading and retrieving templates.

Type Declaration​

clear​

clear: () => void = clearTemplates

Clear all loaded templates from memory.

Returns​

void

get​

get: (template) => string = getTemplate

Retrieve the contents of a template.

Parameters​

template​

string

Name of the template to fetch.

Returns​

string

load​

load: (module, ...folders) => Promise<void> = loadTemplates

Load templates from the given folders.

Parameters​

module​

string

Name of the module these templates belong to.

folders​

...string[]

One or more folders containing Handlebars files.

Returns​

Promise<void>

reload​

reload: (template?) => void = reloadTemplates

Reload template contents from disk.

Parameters​

template?​

string

Template name to reload. If omitted, reloads all templates.

Returns​

void