JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • 0
  • Score
    100M100P100Q24159F
  • License MIT

Some tools for ramda

Package Exports

  • bobda

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (bobda) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Bobda

XO code style npm version

logo

It's an add-on module for Ramda, so all functions are curry.

Table of Contents


Installation

$ yarn add bobda

or $ npm install bobda

Documentation

Async Functions

We used the Bluebird functions and adapted them for use with Ramda

bromiseMap

bromiseMap(asyncFn : Function, array : Array): Promise

This function allows to apply a map but with an asynchronous function

Arguments

asyncFn: The asynchronous function who whant to apply

array: The array who want to apply a map

Exemple

const squareAsync = async value =>
  new Promise(resolve => setTimeout(() => resolve(value * value), 30));

const array = [2, 3, 4, 5];
bromiseMap(incrementAsync)(array); //=> Promise

bromiseAll

bromiseAll(array : Array<Promise>): Promise

This function allows you to wait until all the promises contained in an array are resolved

Arguments

array: The array of promise

Exemple

const squareAsync = async value =>
  new Promise(resolve => setTimeout(() => resolve(value * value), 30));

const squareAsync = async value =>
  new Promise(resolve => setTimeout(() => resolve(value * value), 30));

const value = 2;
R.juxt([incrementAsync, squareAsync])(value); //=> Promise

bromiseProps

bromiseProps(object : Object): Promise

This function allows you to wait until all the promises contained in an object as key are resolved

Arguments

object: The array of promise

Exemple

const squareAsync = async value =>
  new Promise(resolve => setTimeout(() => resolve(value * value), 30));

const squareAsync = async value =>
  new Promise(resolve => setTimeout(() => resolve(value * value), 30));

const value = 2;
R.applySpec({incrementResult: incrementAsync, squareResult: squareAsync})(value) //=> Promise