UNPKG

ttk-app-core

Version:
33 lines (24 loc) 752 B
import React from 'react' import { action as MetaAction, AppLoader } from 'edf-meta-engine' import config from './config' class action { constructor(option) { this.metaAction = option.metaAction this.config = config.current } onInit = ({ component, injections }) => { this.component = component this.injections = injections injections.reduce('init') } onChange = (e) => { this.injections.reduce('modifyContent', e.target.value) } } export default function creator(option) { const metaAction = new MetaAction(option), o = new action({ ...option, metaAction }), ret = { ...metaAction, ...o } metaAction.config({ metaHandlers: ret }) return ret }