pages

App pages

Defines and exports pages
Author:
  • Deux Huit Huit <https://deuxhuithuit.com>
License:
  • MIT
Source:

Methods

(static) create(pageData, keyModel, overrideopt) → (nullable) {page}

Creates a page with the specified model.
Source:
Parameters:
Name Type Attributes Default Description
pageData Object An data bag for your page
keyModel String The page model's unique key
override Boolean <optional>
false Allows overriding an existing page instance
Returns:
Type:
page
Null if something goes wrong

(static) exports(key, model, model, overrideopt) → {pageModel}

Create a new pageModel, i.e. a function to create a new pages. It first calls createPageModel and then calls registerPageModel with the output of the first call.
Source:
Parameters:
Name Type Attributes Default Description
key String The model unique key
model pageParam | pageCreator A page object that conforms with the pageParam type or a pageCreator function that returns a page object.
model pageParam | pageCreator A page object that conforms with the pageParam type or a pageCreator function that returns a page object.
override Boolean <optional>
false Allows overriding an existing page instance
Returns:
Type:
pageModel

(static) getPageForRoute(route) → (nullable) {page}

Returns the first page object that matches the route param
Source:
Parameters:
Name Type Description
route String The route to search match for
Returns:
Type:
page
The page object or null if not found

(static) models() → {Object}

Returns all models
Source:
Returns:
Type:
Object

(static) page(keyOrRoute) → {page}

Returns the page based the key and fallbacks to the route if noting is found.
Source:
Parameters:
Name Type Description
keyOrRoute string the key or the route of the page
Returns:
Type:
page

Type Definitions

pageParam

Page Param
Source:
Type:
  • Object