flask-tasker-client
TypeScript icon, indicating that this package has built-in type declarations

0.1.1 • Public • Published

Flask-Tasker-Client

Client for the flask-tasker framework.

Installation

You can install this package as usual with npm:

npm install flask-tasker-client

Example

// javascript

import {Tasker} from 'flask-tasker-client';

const baseUrl = 'http://localhost:3000';
const tasker = new Tasker({baseUrl});

const dispose = tasker.dispose({
  data: {count: 10},
  onProgress: res => console.log('on progress', res),
  onSuccess: res => console.log('on success', res),
  onError: res => console.error('on error', res),
  onTerminate: res => console.log('on terminate', res)
});
dispose.promise
  .then(res => console.log('on success (promise)', res))
  .catch(err => console.error('on error (promise)', err));

// Simulate task termination.
setTimeout(() => {
  dispose.terminate()
    .then(res => console.log('terminate', res))
    .catch(err => console.error('terminate', err));
}, 1000 * Math.random() * 10);

Resources

Package Sidebar

Install

npm i flask-tasker-client

Weekly Downloads

1

Version

0.1.1

License

MIT

Unpacked Size

25.1 kB

Total Files

6

Last publish

Collaborators

  • xuhuanstudio