Share your code. Components are building blocks, you are the architect.

utils/scan
v1.1.0
1.1.0
MIT
PUBLIC
3
1     DEPENDENCIES
Build: fail
BuildFail
Build Status: fail
Scan is similar to [`reduce`](#reduce), but returns a list of successively

Please configure Bit as a scoped registry to install components with NPM.Learn more

npm config set '@bit:registry' https://node.bitsrc.io
Use utils/scan in your project
npm i @bit/bit.ramda.utils.scan
Copied

scan (fn:Function, acc:*, list:Array) : Array

Scan is similar to reduce, but returns a list of successively reduced values from the left

Example

var numbers = [1, 2, 3, 4];
     var factorials = R.scan(R.multiply, 1, numbers); //=> [1, 1, 2, 6, 24]

Arguments

fn: Function

The iterator function. Receives two values, the accumulator and the current element from the array

acc: *

The accumulator value.

list: Array

The list to iterate over.

Returns

Array

A list of all intermediately reduced values.