@vikfroberg/task

1.0.0 • Public • Published

Task

Uses a similar pattern to Callbags but tailored for single value callbacks

import { pipe, map, andMap, flatMap, fork, resolved } from "@vikfroberg/task"

pipe(
  pipe(
    resolved((firstName) => (lastName) => `${firstName} ${lastName}`), 
    andMap(resolved("John", 2000)),
    andMap(resolved("Doe", 1000)),
  ),
  map(fullName => fullName + "!"),
  fork(e => console.error(e), a => console.log(a))
)

Package Sidebar

Install

npm i @vikfroberg/task

Weekly Downloads

0

Version

1.0.0

License

MIT

Unpacked Size

37 kB

Total Files

9

Last publish

Collaborators

  • vikfroberg