PWA-Engine proposal
API
AppController
config
<[AppConfig]> - app configuration.config
<[AppConfig]> - app configuration. Example
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]>