Omnistac / zedux

:zap: A Molecular State Engine for React
https://Omnistac.github.io/zedux/
MIT License
344 stars 7 forks source link

fix(atoms): disable `ecosystem.find()` fuzzy search if params are passed #103

Closed bowheart closed 2 months ago

bowheart commented 2 months ago

Description

The recent change to add fuzzy search to ecosystem.find() (#79) made the search too fuzzy. Specifically, when atom params are passed to `ecosystem.find() , it's never expected that anything but an exact match is returned. Disable fuzzy search when params are passed.

I'm categorizing this as a bug fix, since the overtly-fuzzy search wasn't expected behavior. But it's also a new feature - e.g. now when passing a search string as the first param, you can pass an empty array as the second param to only return an exact match (or undefined if no match).