unfold
v0.9.6arrow_drop_downv0.9.6
STATUS
Passing
DOWNLOADS
1
VISIBILITY
Public
PUBLISHED
5 years ago
SIZE
N/A
Builds a list from a seed value.
1 contributor
Like
Install unfold as a package?
Copied
npm i @bit/justin-capalbo.ramda.unfold
Set Bit as a scoped registryLearn more
npm config set '@bit:registry' https://node.bit.cloud
Component Example modifieddraft
React
React
Vue
Angular
React Native
Add dependency... help_outline
Just
and packages in Bit or NPM to the example. any of the 1 million componentstoggle layout
No preview available
chevron_left
chevron_right
unfold (
fn:
Function
,seed:
) : *
Array
Builds a list from a seed value. Accepts an iterator function, which returns either false to stop iteration or an array of length 2 containing the value to add to the resulting list and the seed to be used in the next call to the iterator function.
The iterator function receives one argument: (seed).
Example
Arguments
fn:
Function
The iterator function. receives one argument, seed
, and returns
either false to quit iteration or an array of length two to proceed. The element
at index 0 of this array will be added to the resulting array, and the element
at index 1 will be passed to the next call to fn
.
seed:
*
The seed value.
Returns
Array
The final list.