Skip to content
This repository has been archived by the owner on May 4, 2021. It is now read-only.
/ async-flow Public archive

async-flow is a tiny async function piping utility

License

Notifications You must be signed in to change notification settings

reaktivo/async-flow

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GitHub license npm version CircleCI Status Coverage PRs Welcome

async-flow is a tiny javascript function piping utility

Installation

npm install -g @reaktivo/async-flow

Usage

import asyncFlow from "@reaktivo/async-flow";

const api = asyncFlow(fetch, res => res.json(), json => json.data);

// Which is equivalent to the following
const api = function(...args) {
  return fetch(...args)
    .then(res => res.json())
    .then(json => json.data);
};

//Or
const api = async function(...args) {
  const response = await fetch(...args);
  const json = await response.json();
  return json.data;
};

License

async-flow is open source software licensed as MIT.

About

async-flow is a tiny async function piping utility

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published