Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return sources => {
const _stream = resolveStateMapper(stream, sources)
const instances$ = _stream.fold(function (acc, next) {
const key = next && next.key || uniqueId()
const cmp = getCmp(next)
const sinks = cmp(sources)
acc.dict.clear()
acc.dict.set(key, sinks)
return { dict: acc.dict, arr: [{ ...sinks, _key: key }] }
}, { dict: new Map(), arr: [] })
return collectSinksBasedOnSource(sources)(new Instances(instances$))
}
}
return cum.concat({ ...acc.dict.get(key), _key: key })
}, [])
acc.dict.forEach((_, key) => {
if (!keys.has(key)) {
acc.dict.delete(key)
}
})
keys.clear()
return { dict: acc.dict, arr: nextInstArray }
}, { dict: new Map(), arr: [] })
return collectSinksBasedOnSource(sources)(new Instances(instances$))
}
}