1.0.0-beta6 • Published 6 years ago
experimentation-mesg-js v1.0.0-beta6
MESG.js
Services
Let's take this really simple service example
name: example
events:
eventX:
data: {}
tasks:
start:
inputs:
isValid:
type: Boolean
outputs:
valid:
data: {}
error:
data: {}
Listen for tasks
const MESG = require('mesg/service')
const start = ({ isValid }, { valid, error }) => isValid
? valid({})
: error({})
MESG.listenTask({ start })
Emit event
const MESG = require('mesg/service')
MESG.emitEvent("eventX", {
foo: "bar"
}).then(...)
1.0.0-beta6
6 years ago
1.0.0-beta5
6 years ago
1.0.0-beta4
6 years ago
1.0.0-beta3
6 years ago
1.0.0-beta2
6 years ago
1.0.0-beta1
6 years ago
1.0.0
6 years ago