Giter Club home page Giter Club logo

hoodie-task-client's Introduction

hoodie-task-client

client api for asynchronous task queue, using PouchDB for sync

Build Status Coverage Status Dependency Status devDependency Status

Example

taskQueue('email').start({
  to: '[email protected]',
  subject: 'Ohaj there',
  body: 'Hey John,\n\nhow are things?\n\n– Jane'
}).then(function (task) {
  alert('Email "' + task.subject + '" sent')
}).catch(function (error) {
  alert(error)
})

API

var taskQueue = new TaskQueue(userId, options)

mailQueue = taskQueue('mail')
taskQueue.on(eventName, handler)
taskQueue.one(eventName, handler)

mailQueue.start(attributes/*, options */)
mailQueue.abort(id/*, options */)
mailQueue.restart(id/*, options */)
mailQueue.on(eventName, handler)
mailQueue.one(eventName, handler)

Events, same for mailQueue.on / one and taskQueue.on / one

mailQueue.on('start', handleNewTask)
mailQueue.on('success', handleNewTaskSuccess)
mailQueue.on('error', handleNewTaskError)

Testing

Local setup

git clone https://github.com/hoodiehq/hoodie-task-client.git
cd hoodie-task-client
npm install

Run all tests and code style checks

npm test

Run all tests on file change

npm run test:watch

Run specific tests only

node tests/specs # run unit tests
node tests/specs/get-api # run .getApi() unit tests
node tests/integration/walkthrough # run walkthrough integration test
# PROTIP™ Pipe output through a [pretty reporter](https://www.npmjs.com/package/tape#pretty-reporters)

License

Apache 2.0

hoodie-task-client's People

Contributors

gr2m avatar greenkeeperio-bot avatar greenkeeper[bot] avatar interdigitize avatar inator avatar leighphan avatar gitsemere avatar lowprofiledog avatar

Watchers

James Cloos avatar Matt Brumwell avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.