You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

35 lines
870 B

import logic from './logic';
import context from './context';
export default `
(async function run() {
// Context
${context.replace(/export\s+default/, '')}
// Logic
${logic
.split('\n')
.filter(line => !line.match(/import nodeFns/) && !line.match(/import Context/))
.join('\n')
.replace(/export\s+default/, '')
.replace(
`import EventEmitter from 'eventemitter3';`,
`const EventEmitter = (await import('https://jspm.dev/eventemitter3')).default;`
)
}
// DSL
// define dsl here
// nodeFns map
// define nodeFns here
// instantiation and invoke
const logic = new Logic({ dsl });
logic.invoke('$TRIGGER$', {}, (pipe) => {
const ctx = logic._getUnsafeCtx();
const context = ctx.getContext();
window.dispatchEvent(new CustomEvent('iMoveOnlineExecEnds', {detail: {pipe, context}}));
});
})();
`;