Function
Static Public Summary | ||
public |
chain(iterables: ...Iterable): IterableIterator Chains input iterables one after the other. |
Static Private Summary | ||
private |
* _chain(iterables: Iterable[]): IterableIterator Chains input iterables one after the other. |
Static Public
public chain(iterables: ...Iterable): IterableIterator source
import chain from '@iterable-iterator/chain/src/chain.js'
Chains input iterables one after the other. Returns an iterable iterator that yields all values of the first input iterable, then all values of the second, etc.
Params:
Name | Type | Attribute | Description |
iterables | ...Iterable | The input iterables to chain. |
Return:
IterableIterator |
Example:
// returns [ 0 , 1 , 0 , 1 , 2 ]
list( chain( range( 2 ) , range( 3 ) ) ) ;
Static Private
private * _chain(iterables: Iterable[]): IterableIterator source
import _chain from '@iterable-iterator/chain/src/_chain.js'
Chains input iterables one after the other. Returns an iterable iterator that yields all values of the first input iterable, then all values of the second, etc.
Params:
Name | Type | Attribute | Description |
iterables | Iterable[] | The input iterables to chain. |
Return:
IterableIterator |
Example:
// returns [ 0 , 1 , 0 , 1 , 2 ]
list( _chain( [ range( 2 ) , range( 3 ) ] ) ) ;