pacocoursey / cmdk

Fast, unstyled command menu React component.
https://cmdk.paco.me
MIT License
9.03k stars 258 forks source link

feat: export defaultFilter #229

Closed evanob closed 3 months ago

evanob commented 3 months ago

Exporting the defaultFilter would allow users to re-use the internal command-score implementation with their own wrapping function. For example, we might want to transform one or more of the arguments before calling it.

import { Command, defaultFilter } from 'cmdk'

<Command 
  filter={(value, search, keywords) => 
    defaultFilter(value, search.replaceAll(' ', ''), keywords)
  }
>
  ...
</Command>
vercel[bot] commented 3 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
cmdk-website ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 8, 2024 1:37pm
e1himself commented 2 months ago

Hi! Is it planned to release this soon-ish? Thanks!