0.0.9 • Published 6 years ago
lib-pwa-engine v0.0.9
PWA-Engine proposal
API
AppController
import appConfig from './app_config.js'
import dataSource from './datasource.js'
new AppController(appConfig, dataSource);
mountLang(shellName)
mountTemplate(shellName, templateName)
shellName
<String>templateName
<String> - template name described in shell's index.js- returns <Promise>
localizeTemplate(shellName)
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)
mountContainer(name, action)
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
container
shell
lang
script
Backend
Object that provides at least next methods:
delegateAppController
controller
<Object>
renderToRoot
container
<ReactRenderable>lang
<Object>
dispatch
action
<Object>