Skip to content

Flip arguments #1

@busypeoples

Description

@busypeoples

I think passing in the Task as the first argument opens up more opportunities.
We could partially apply the Task implementation for example or map over a list of things to taskify etc. What do you think?

const taskify = require('util.taskify')
const dataTask = require('data.task')

const task = taskify(dataTask)
const readFile = task( fs.readFile)

readFile('package.json', 'utf8')
  .fork(
    err => console.error('Failed.', err),
    str => console.log('Done!', str)
  )

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions