Skip to content
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

Some possible documentation clarification #138

Open
sirmspencer opened this issue May 3, 2023 · 2 comments
Open

Some possible documentation clarification #138

sirmspencer opened this issue May 3, 2023 · 2 comments

Comments

@sirmspencer
Copy link

sirmspencer commented May 3, 2023

I've been struggling to get promesa implemented correctly, at least with regard to pathom EQL. Just today I think I finally figured out the confusion. fn/macros like p/let and p/-> don’t create a promise, they chain a promise (like .then). So for each async call, you need to create the promise first. The would be with a fn/macro like p/future.

If I am correct, then the documentation can use a little more clarification. p/let and p/future both say they return a promise, but do two completely different things. If there was a clarification of what created a promise verses chained a promise that would go miles.

@sirmspencer
Copy link
Author

sirmspencer commented May 3, 2023

In retrospect, it might be clear to anyone knowing the difference, but my whole team struggled with this. I think it's possible we came in with some poor examples from a different library, and the language in the promeso docs wasn't enough to overcome that part.

Great work overall!

@niwinz
Copy link
Member

niwinz commented May 20, 2023

concretly, the p/let macro accepts promise and non promise values, and they all will be chained correctly, so technically you don't need to explicit creation of promises. p/let will always return a promise independently of what happened inside the macro context, because it firtly wraps all in promise context.

In any case, you you have concrete doubts or issues with the documentation, please, feel free to ask or contribute an improvement

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

2 participants