Open
Description
The current implementation of the callback chain in 5a-chain
passes data from the previous callback but doesn't pass arguments explicitly mentioned in .do()
.
In usage example readConfig
callback is expected to receive myConfig
as an argument.
const startChain = chain()
.do(readConfig, 'myConfig')
.do(selectFromDb, 'select * from cities')
.do(getHttpPage, 'http://kpi.ua')
.do(readFile, 'README.md');
However it receives undefined
instead.
So if callbacks would really depend on the previous one the chain would fail once it was called.
Also, should only the first callback in the chain receive an explicit argument, and the following ones receive their arguments from the previous one? Or should they receive both explicit and implicit arguments?
Metadata
Metadata
Assignees
Labels
No labels