This module contains functions for starting JS on the browser side
import * from "@quintype/framework/client/start";
Members
Methods
# static maybeNavigateTo(path, store) → {void}
Navigate to the page if it is not the current page as per redux. This internally calls navigateToPage
This function can also be called as app.maybeNavigateTo()
.
Parameters:
Name | Type | Description |
---|---|---|
path |
string
|
The new path |
store |
Redux
|
The redux store |
void
# static maybeSetUrl(path, title) → {void}
Sets the url and title
- This function can also be called as
app.maybeSetUrl()
.
Parameters:
Name | Type | Description |
---|---|---|
path |
string
|
The new path |
title |
string
|
The new title. |
void
# static navigateToPage(dispatch, path, doNotPushPath) → {void}
navigateToPage is called when hydrating the initial page, or moving between pages with AJAX. You may want to consider calling maybeNavigateTo instead.
This function can also be called as app.navigateToPage()
.
Parameters:
Name | Type | Description |
---|---|---|
dispatch |
function
|
The dispatch of the story |
path |
string
|
The new path you are jumping to |
doNotPushPath |
boolean
|
If set to true, then the path is not appended to pushState |
void
# static renderBreakingNews(container, store, view, props)
Parameters:
Name | Type | Description |
---|---|---|
container |
string
|
The id of the container to render the given component |
store |
Redux
|
The redux store |
view |
*
|
The view to be rendered |
props |
Object
|
Properties to bootstrap the component with |
# static renderComponent(clazz, container, store, props, callback)
renderComponent can be used to render a component given the component, container and a redux store.
Parameters:
Name | Type | Description |
---|---|---|
clazz |
Component
|
The component to render |
container |
string
|
The id of the container to render the given component |
store |
Redux
|
The redux store |
props |
Object
|
Properties to bootstrap the component with |
hydrate |
boolean
|
Hydrate the component instead of rendering it |
callback |
callback
|
Callback on completion |
# static renderIsomorphicComponent(container, store, pickComponent, props)
renderIsomorphicComponent can be used to render a component given the container and a redux store. This uses IsomorphicComponent internally.
Parameters:
Name | Type | Description |
---|---|---|
container |
string
|
The id of the container to render the given component |
store |
Redux
|
The redux store |
pickComponent |
function
|
The pickComponent function |
props |
Object
|
Properties to bootstrap the component with |
hydrate |
boolean
|
Hydrate the component instead of rendering it |
# static startApp(renderApplication, reducers, opts) → {Redux}
Start the Browser Application. This is the entry point for the Quintype framework
Parameters:
Name | Type | Description |
---|---|---|
renderApplication |
function
|
Once the data is fetched, renderApplication(store) will be called to render all components on page. See renderApplication |
reducers |
Object
|
A list of custom reducers for your application. This will be merged with the built in reducers |
opts |
Object
|
Options |
preRenderApplication |
function
|
Render a part of the application on boot. See preRenderApplication |
fcmMessagingSenderId |
function
|
string
|
Enable Firebase Cloud Messaging for push notifications |
enableServiceWorker |
boolean
|
Should service worker be enabled |
serviceWorkerLocation |
string
|
Location of the service worker (default: /service-worker.js). Note, if using mountAt, this is relative to the mount point. |
appVersion |
number
|
App Version. See Updating App Version |
The store that was created
Redux