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

Cancel uncompleted actions on repeat #29

Closed
filipjnc opened this issue Jul 29, 2018 · 1 comment
Closed

Cancel uncompleted actions on repeat #29

filipjnc opened this issue Jul 29, 2018 · 1 comment

Comments

@filipjnc
Copy link

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report  
[ ] Performance issue
[x] Feature request
[x] Documentation issue or request
[ ] Support request
[ ] Other... Please describe:

Current behavior

Running three actions of the same type in a row will always result in three updates of the store.

Expected behavior

The ability to set an option that would cancel the execution of the previous action stream (switchMap behavior).

Maybe something like:
{ type: '[Todos] Fetch All', cancelUncompleted: true }

What is the motivation / use case for changing the behavior?

Clicking three times on the fetch button should normally not end up in three updates of the store.

I am not sure Akita can support this out of the box, but at least a documentation recipe of how can this be achieved with RxJS would be helpful.

@NetanelBasal
Copy link
Collaborator

It's not related to Akita. You can use the exhaustMap operator.

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