1.0.6 • Published 5 years ago

sync-array v1.0.6

Weekly downloads
3
License
MIT
Repository
github
Last release
5 years ago

Arry operation

Sync funcitons for Array.

Void Excepton Maximum call stack size exceeded

Installation

yarn add sync-array

or

npm i --save sync-array

Examples

import array from 'sync-array';
// import forEach from 'sync-array/foreach';
// const { forEach, map, every, filter, some, reduce, reduceRight } = require('sync-array').default;

function sleep(timeout: number){
	return new Promise<void>((resolve)=>{
		setTimeout(resolve, timeout);
	});
}

const arr = [1000, 500, 100];

arr.forEach(async (it)=>{
	await sleep(it);
	console.log(it);
});

// 100
// 500
// 1000

array.forEach(arr, async (it)=>{
	await sleep(it);
	console.log(it);
});
// 1000
// 500
// 100
1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago