0.1.7 • Published 7 years ago

task-from-fn v0.1.7

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

NOTE: this library's functionality has now been implemented in Folktale: https://origamitower.github.io/folktale/en/folktale.data.task.fromnodeback.html

task-from-fn

npm.io npm.io

Convert a JavaScript function with node-style callback in to a Task from the data.task package.

Installation

$ npm install task-from-fn --save

or with yarn,

$ yarn add task-from-fn

Usage

const taskFromFn = require('task-from-fn')
const fs = require('fs')

const readFile = taskFromFn(fs.readFile)
const task = readFile('path/to/file', 'utf-8')

task.fork(
  e => console.error(e), // handle error
  data => console.log(data) // handle file data
)
0.1.7

7 years ago

0.1.6

7 years ago

0.1.5

7 years ago

0.1.4

7 years ago

0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago