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 extra info for onSuccess callback #12

Open
unframework opened this issue Sep 9, 2019 · 1 comment
Open

Some extra info for onSuccess callback #12

unframework opened this issue Sep 9, 2019 · 1 comment

Comments

@unframework
Copy link

unframework commented Sep 9, 2019

Hi Sebastien, thanks for adding onSuccess hooks! Just noting a couple things that could improve the usage flexibility.

  • often there is a need to know not just the result but also the original params that went into the execute method call (there is a workaround possible, but still could be nice to have this)
  • most of the time we need to ignore onSuccess if the operation/screen is no longer relevant, to not show unexpected toast message/do setState/etc; the former check can be accomodated via the isCurrent call (although I am not sure why it needs a call rather than being just a boolean), but the latter needs an is-mounted check, which would be great to pass in as a flag to onSuccess as well

Thanks for your work on this library, cheers!

@slorber
Copy link
Owner

slorber commented Sep 9, 2019

Hi,
Great you like the lib :)

  1. there is a result.currentParams returned. If you really need the params of the success/error calls, I'm ok to include this

  2. I need it to be a call because you might want to show an error message and dismiss it 2secs later. isCurrent may help you avoid dismissing the wrong error message. I'd be ok to include isMounted into the callback if it helps

I don't have time this week to work on this but if you want feel free to open a PR :)

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