Skip to content

.do arguments not passed correctly #14

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
jesuisYves opened this issue Feb 12, 2025 · 0 comments
Open

.do arguments not passed correctly #14

jesuisYves opened this issue Feb 12, 2025 · 0 comments

Comments

@jesuisYves
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant