0.1.1 • Published 6 years ago

@jaredlunde/juxt v0.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
6 years ago

juxt (juxtaposition)

Creates a function that calls multiple functions with the same arguments.

Takes several functions and returns a function that applies its arguments to each of those functions. An array of the results is returned.

Installation

yarn add @jaredlunde/juxt or npm i @jaredlunde/juxt


Usage

juxt (fn<function>, fn<function>...)

  • returns {array}
import juxt from '@jaredlunde/juxt'


const incr = val => val + 1
const decr = val => val - 1


const juxtaposedCount = juxt(incr, decr)
juxtaposedCount(0)
// [1, -1]