redux-search | Redux bindings for client-side search | State Container library
kandi X-RAY | redux-search Summary
kandi X-RAY | redux-search Summary
This README provides a quick introduction of redux-search. For more details refer to the API documentation. redux-search searches collections of documents and returns results as an Array of document ids. It is important to note that the documents themselves aren't returned. This is because the actual search is performed in a web-worker thread for performance reasons. In order to avoid serializing the documents and passing them back and forth, redux-search simply passes their ids. Because of this, each document must contain an id attribute. redux-search provides an action for searching resources as well as selectors for getting search results and the current search text. It then watches the store for resource changes and automatically updates search results as needed. Note that redux-search currently depends on the Regenerator runtime. It is recommended that your project require the babel-polyfill to provide that runtime.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of redux-search
redux-search Key Features
redux-search Examples and Code Snippets
Community Discussions
Trending Discussions on redux-search
QUESTION
Summary:
Now that this problem is solved, I'll do a blog post with re-creation and solution
Adding Redux-Search to my app. I've got the store setup properly, my redux dev tools show the search action kicking off on init
and receiving a proper result, but when I'm actually trying to search the resource using the value submitted with an input field, I'm not getting anything returned. I'm entirely stuck and I've tried a bunch of different structures to try and get ANY result to return in the component console.log. I suppose I just don't understand how the reselect package is working, how to pass the text to it properly, and how to grab the result in my component. If I can get over that hurdle and see something returned from the action creator, I'll be able to take it from there.
Here's my code:
Reducers/Data.js To give background on this file. I have two reducers. One called Auth, one called Data (in separate files). Each has their own initial state. The initital state shown here is a portion of that defined in data.js.
...ANSWER
Answered 2018-Jul-14 at 15:36The first problem is that the redux-search SEARCH
reducer isn't triggered when your app's "Search" button is clicked. (I can see a debug and see that it's never reached.) That's because your click handler is calling the unconnected method actions.searchThings(value)
rather than using the connected method this.props.searchThings(value)
.
The second problem is related. Your console log is referencing the unconnected selectors.thingIds
rather than the connected this.props.thingIds
.
After doing this, I see the ids I would expect being logged to the console.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install redux-search
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page