Solvedreactivesearch Option to clear all filters programmatically

Hi ,

Is there a way by which we can clear all the filters being applied programmatically.

8 Answers

✔️Accepted Answer

Hi @Arvind6353, we had an internal discussion on this and it seems it's not as trivial as it seemed initially. We want to do this right without exposing any vulnerability. We are thinking of exposing an HOC connector which will expose such utility methods but this spec isn't finalised yet. So, I will get back to you on this once we have something credible.

In order to achieve this with the current setup, you can import connect method along with the clearValues action from the core and simply connect any desired component to reactivesearch-redux-store via connect method and dispatch clearValues as needed.

import React, { Component } from 'react';
import { connect } from '@appbaseio/reactivesearch/lib/utils';
import { clearValues } from '@appbaseio/reactivecore/lib/actions';

class MyComponent extends Component {
	...
}

const mapDispatchtoProps = dispatch => ({
	clearValues: () => (dispatch(clearValues())),
});

export default connect(
	null,
	mapDispatchtoProps,
)(MyComponent);

Note that you will have full access to the redux store via this connect method, so you can do as you please. With great power, comes great responsibility.

Related Issues:

3
reactivesearch Option to clear all filters programmatically
Hi @Arvind6353 we had an internal discussion on this and it seems it's not as trivial as it seemed i...
425
puppeteer Failed to download Chromium r536395! Set "PUPPETEER_SKIP_CHROMIUM_DOWNLOAD" env variable to skip download.
Solves the issue to me. Steps to reproduce Tell us about your environment: Puppeteer version: Not in...
365
puppeteer How to get text from a element ?
You can try this: or this: This might be a Obvious question but ...
326
puppeteer Chrome Headless doesn't launch on Debian
for the dockerisers amongst us - i've launched successfully with this setup: Running this example co...
285
puppeteer Ubuntu 18.04 Headless Chrome Node API - Puppeteer - Installation Guide
Based on https://github.com/GoogleChrome/puppeteer You only have to run the following command in Ubu...
252
puppeteer how to check if selector exists or is present ?
As a variant: how to check if selector exists or is present waiting for (x) time or when the page is...
233
puppeteer Installation fails on Apple Silicon / M1
The solution for me using Chromium from Homebrew was: You will get a security warning ...
200
puppeteer npm install -g puppeteer fails
This command ended up working for me in case anyone lands here by googling the error: sudo npm insta...
162
puppeteer can't run puppeteer in centos7
@zhuyingda 's notes above will allow you to run puppeteer with --no-sandbox Server Info: CUP: Intel(...
155
puppeteer Headless mode is not working
I had the same issue I then added await page.screenshot(...) to see what's going on in headless mode...
136
terragrunt Upgrading to Terraform 0.12: separate configuration file for Terragrunt?
Hi all Hi! I'm one of the engineers at HashiCorp who works on Terraform Core As you might be aware ...
116
puppeteer Run from Electron
For me the solution was a combination of the approach of @qathom and @tpkn: But in my case the array...
111
zeal Content rendering error in MDN (HTML, JS, CSS) docsets
I find it can fix temporary by remove the CSS.docset\Contents\Resources\Documents\developer.mozilla....
102
puppeteer How to scrape an element
The following should work: Hi I think this is an obvious question but still I cannot figure out how ...
98
puppeteer ERROR:zygote_host_impl_linux.cc(89)] Running as root without --no-sandbox is not supported
@ststeiger so which are the launch options? Like Or do I need to add args: ['--no-sandbox' '--disabl...
96
puppeteer Page.setContent should wait for resources to be loaded
Meanwhile a good workaround for page.setContent that waits for all the resources to load: ...
81
puppeteer Request: browser.currentPage() or similar way to access Pages
To get the first page of the current browser I was playing around with Puppeteer today and I found o...
75
gitsome Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-7SrToZ/gitsome/
I had the same problem on OSX and Solve my issue (I have both python versions installed). ...
75
puppeteer Error: Failed to launch chrome! spawn /app/node_modules/puppeteer/.local-chromium/linux-609904/chrome-linux/chrome ENOENT
@arapocket Thanks for commenting—I forgot to follow up after I found a solution It's been a couple o...
68
puppeteer Error: Failed to launch the browser process! spawn chrome.exe ENOENT
For me on Linux the only way to resolve is by installing some dependencies: Source ...
68
puppeteer EventEmitter memory leak detected. 11 exit listeners added
@selfrefactor ah indeed you launch chrome processes in parallel Every chrome instance adds a listene...
66
puppeteer Collect element attributes from selector
i think this would do it And once #625 is implemented this will be.. Beginner user here Started play...
64
puppeteer Puppeteer Won't Click on Element
In my case I'm able to use this reliably: page.$eval(selectorStr elem => elem.click()); ...
60
puppeteer Execution context was destroyed, most likely because of a navigation
@THE-GAME-YOU-LOST I see The right thing to do would be to await navigation caused by page.click ...
60
puppeteer Page.click() does not work with an input selector
I'm running into the same issue Strangely if I use page.evaluate it does work For example: I'd be cu...
59
puppeteer Different behavior between { headless: false } and { headless: true }
As mentioned in the article @Garbee posted the headless version does not have languages set on the n...
57
puppeteer Puppeteer with headless:true is extremely slow
Hey guys so I've found a workaround for this Though this issues has been raised in #1550 but it was ...
54
puppeteer Issue with deploying puppeteer on heroku (with resolution)
Did you try puppeteer.launch({args: ['--no-sandbox' '--disable-setuid-sandbox']});? ...
46
puppeteer Query nodes within shadow roots
TL;DR: try Copy JS Path in Chrome Canary to get a js selector for nodes inside Shadow DOM ...
39
puppeteer Issue when deploying with node:8-alpine (docker)
Can we re-open this? There doesn't seem to be a documented solution for running Puppeteer on Alpine ...
38
puppeteer Emit new Page objects when new tabs created
The target object is defined at https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#cl...
37
puppeteer Support OOPIF
While we're figuring this out a workaround is to run with --disable-features=site-per-process flag: ...
37
puppeteer Support browser contexts to launch different sessions
Ok I got this working Thanks for the tip @ks07 UPDATE (2017-11-04): I've updated the example with a ...
36
puppeteer How to stop puppeteer follow redirects
Coupling request interception with request.isNavigationRequest and request.redirectChain you can now...
35
puppeteer Error generating PDFs: Protocol error (Page.printToPDF): Target closed.
Was getting the same error on pptr v1.12.2 but was able to fix it by setting pipe: true when launchi...
34
puppeteer Certificates error using puppeteer
You can also set an args array inside the launch config args: [ '--ignore-certificate-errors' ] I ha...
34
puppeteer Click event is not firing
The following works for me Note the 'networkidle' argument for page.goto Also the delay in typing is...
33
puppeteer Ability to prevent header/footer on certain pages
I hope this solution helps someone even though it's super hacky I had a need to remove the header on...
33
streamlit Ability to download data from Streamlit
I think csv download would be ideal as a part of st.dataframe i would really love to see a button in...
32
puppeteer What is "Page crashed!" error?
This worked Copied from https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.m...
31
puppeteer Navigation Timeout Exceeded when using networkidle0 and no insight into what timed out
I suppose an array of the remaining open network connections would at least enable the developer to ...
30
puppeteer SSL Certificate error: ERR_CERT_AUTHORITY_INVALID on certain sites
I've got it working with: browser = await puppeteer.launch({ headless: false slowMo: 250 ignoreHTTPS...
30
puppeteer Client certificate authentication on pages.
Here is how I got around client cert authentication hope it helps others Basically just intercept th...
29
puppeteer Module not found error can't resolve 'ws' in puppeteer-core/lib
For me this happened when bundling with webpack intending the bundle to be used in node The trick wa...
28
puppeteer When would an error "Cannot find context with specified id undefined" happen?
Hi encountered this problem when updating code that was using puppeteer < 1.0 to newest version I wa...
28
puppeteer Feature Request: To have drag and drop feature or mouse hold
@shmdhussain you can do something like this: Feature Request: To have drag and drop feature: Is ther...
28
puppeteer Feature Request: wait for selectors array (race)
A much simpler solution is to just use the CSS comma I often wait for one of multiple possible selec...
27
streamlit Watchdog error on install (Mac)
I saw a comment from Mark Conway saying that you need to install watchdog first and then install str...
26
puppeteer Error: Protocol error (Runtime.callFunctionOn): Target closed.
Just to make @aslushnikov's comment more explicit with an example right here I'm running into this e...
24
puppeteer Possibility to have full height PDF
You can query the document height first and then use it as an argument to page.pdf ...