enkidevs / react-search-input

:mag: Simple react.js component for a search input, providing a filter function.
302 stars 72 forks source link

reversed result #137

Closed donguinesjay closed 6 years ago

donguinesjay commented 6 years ago

How can I display the data that is not equal to the one that I typed in the input field? just like splicing an array

mathieudutour commented 6 years ago
const originalFilterFunc = createFilter(this.state.searchTerm, KEYS_TO_FILTERS)
const reversedFilter = function () { return ! originalFilterFunc(arguments) }
const filteredEmails = emails.filter(reversedFilter)