lib-pwa-engine
v0.0.9
Published
This is revisied version of AppController from current template-pwa, this is the interface which available for [shell's manifest](#manifest). AppController #### mountLang(shellName) + `shellName` <[String]> + returns <[Promise]> #### mountTemplate(shellNa
Downloads
8
Readme
PWA-Engine proposal
API
AppController
config
<[AppConfig]> - app configuration.config
<[AppConfig]> - app configuration. Example
import appConfig from './app_config.js'
import dataSource from './datasource.js'
new AppController(appConfig, dataSource);
mountLang(shellName)
shellName
<[String]>- returns <[Promise]>
mountTemplate(shellName, templateName)
shellName
<[String]>templateName
<[String]> - template name described in shell's index.js- returns <[Promise]>
localizeTemplate(shellName)
shellName
<[String]>- returns <[Promise]>
unmountTemplate(shellName, templateName)
shellName
<[String]>templateName
<[String]> - template name described in shell's index.js- returns <[Promise]>
mountScript(shellName, scriptName)
shellName
<[String]>scriptName
<[String]> - filename of js file placed in shell's scripts folder- returns <[Promise]>
unmountStyle(shellName, styleName)
shellName
<[String]>styleName
<[String]>- returns <[Promise]>
mountContainer(name, action)
name
<[String]>action
<[Object]>- returns <[Promise]>
Requirements
Resource loaders
AppController requires you to provide resource loaders in config. You should provide async functions that returns Promise in config.resources, for next resources:
backend
- returns <[Promise].<Backend>>
container
name
<[String]> - container's name- returns <[Promise]>
shell
name
<[String]> - shell's name- returns <[Promise]>
lang
lang
<[String]> - languagename
<[String]> - file name- returns <[Promise]>
script
shell
<[String]> - shell's namename
<[String]> - script's name- returns <[Promise]>
Backend
Object that provides at least next methods:
delegateAppController
controller
<[Object]>
renderToRoot
container
<[ReactRenderable]>lang
<[Object]>
dispatch
action
<[Object]>