experimentation-mesg-js

1.0.0-beta6 • Public • Published

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(...)

Readme

Keywords

none

Package Sidebar

Install

npm i experimentation-mesg-js

Weekly Downloads

2

Version

1.0.0-beta6

License

ISC

Unpacked Size

4.95 kB

Total Files

8

Last publish

Collaborators

  • antho1404