UNPKG

mk-mobile-command

Version:
33 lines (26 loc) 813 B
import React from 'react' import ReactDOM from 'react-dom' import { action as MetaAction, AppLoader } from 'mk-meta-engine' import config from './config' class action { constructor(option) { this.metaAction = option.metaAction this.config = config.current this.webapi = this.config.webapi } onInit = ({ component, injections }) => { this.component = component this.injections = injections injections.reduce('init') } world = () => { this.metaAction.sf('data.content', 'hello world') } } export default function creator(option) { const metaAction = new MetaAction(option), o = new action({ ...option, metaAction }), ret = { ...metaAction, ...o } metaAction.config({ metaHandlers: ret }) return ret }