nested-promise-all

1.0.1 • Public • Published

nested-promise-all

const nestedPromiseAll = require('nested-promise-all')

const result = await nestedPromiseAll({
  foo: new Promise(r => setTimeout(() => r('foo-result'), 300)),
  bar: {
    hello: new Promise(r => setTimeout(() => r('hello-result'), 100)),
    world: {
      yo: new Promise(r => setTimeout(() => r('yo-result'), 200))
    }
  }
})

console.log(result)

// outputs :
//
// { 
//	foo: 'foo-result',
//	bar: { 
//		hello: 'hello-result', 
//		world: { 
//			yo: 'yo-result' 
//		} 
//	} 
// }

Readme

Keywords

none

Package Sidebar

Install

npm i nested-promise-all

Weekly Downloads

3

Version

1.0.1

License

ISC

Unpacked Size

3.81 kB

Total Files

4

Last publish

Collaborators

  • vvanghelue