0.0.12 • Published 9 years ago

seneca-await v0.0.12

Weekly downloads
3
License
ISC
Repository
-
Last release
9 years ago

Seneca Async

Use async / await methods with seneca.

Install

npm install seneca-await

Setup

You need to have babel to use await functions.

http://babeljs.io/docs/plugins/transform-async-to-module-method/

Usage

import Seneca from 'seneca-await'

const seneca = Seneca()

async function addHello(msg) {
  return `Hello ${msg}`
}

seneca.add('role:test,cmd:sayhello', async function(msg) {
  const text = await addHello(msg.name)
  return {text: text}
})

async function start() {
  await seneca.ready()

  const response = await seneca.act('role:test,cmd:sayhello,name:Person')
  console.log(response.text) // => Hello Person
}

start()
0.0.12

9 years ago

0.0.11

9 years ago

0.0.10

10 years ago

0.0.9

10 years ago

0.0.8

10 years ago

0.0.7

10 years ago

0.0.6

10 years ago

0.0.5

10 years ago

0.0.4

10 years ago

0.0.3

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago