mirror of
https://github.com/orbitdb/orbitdb.git
synced 2025-03-30 15:08:28 +00:00

Use immutable ipfs-log. Simplify internals. Remove obsolete dependencies. Update dependencies. Use @dignifiedquire's mapSeries for Promises. Split tests to individual stores. Improve tests. Fix build process. Build size down to 121kb. Fix benchmarks and examples. Move Cache to Stores (and to its own module).
17 lines
371 B
JavaScript
17 lines
371 B
JavaScript
'use strict'
|
|
|
|
// https://gist.github.com/dignifiedquire/dd08d2f3806a7b87f45b00c41fe109b7
|
|
|
|
module.exports = function mapSeries (list, func) {
|
|
const res = []
|
|
return list.reduce((acc, next) => {
|
|
return acc.then((val) => {
|
|
res.push(val)
|
|
return func(next)
|
|
})
|
|
}, Promise.resolve(null)).then((val) => {
|
|
res.push(val)
|
|
return res.slice(1)
|
|
})
|
|
}
|