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

Is there a way to update query params? #39

Closed
arddor opened this issue Dec 8, 2016 · 2 comments
Closed

Is there a way to update query params? #39

arddor opened this issue Dec 8, 2016 · 2 comments

Comments

@arddor
Copy link

arddor commented Dec 8, 2016

Is it possible to update / alter query params after subscribing? The reason why I'm asking is that I'm working on a data table and it should be possible to change sorting persistently. Currently I'm just refetching the data, however on a create or update it goes back to the original defined sorting.

I guess the proper way is to unsubscribe and then subscribe again with the new query params?

@daffl
Copy link
Member

daffl commented Dec 8, 2016

I did that with RXJS directly:

const service = app.service('messages');
const query = new RxJS.BehaviorSubject({ $skip: 0 });

const find = query.mergeMap(query => service.find({ query }));

find.subscribe(data => console.log('Data is', data));

query.next({ $skip: 10 });

@arddor
Copy link
Author

arddor commented Dec 9, 2016

Awesome thank you

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