Code Monkey home page Code Monkey logo

Comments (3)

SweVictor avatar SweVictor commented on July 26, 2024 1

@kentcdodds: Sure, why not. You have after all taken the time to create the library!

An example is here
https://codesandbox.io/s/match-sorter-example-forked-1ko35

"Share a link in the docs" - does that mean create a PR? (never mind, figured it out. Github is helpful these days 😄 )

from match-sorter.

SweVictor avatar SweVictor commented on July 26, 2024

As a comment for the above approach, what I am missing is the ability to prioritize columns. Say you have name and tags in a data row object. If all else fails a "contains" match in tags is better than returning nothing, but "contains" in name would be a much better match.

Would it be possible to adjust the rank per key? So key = 'name', rank= +5, key='tags, rank = -10 for example? Not sure if values make sense, but basically to offset the ranking to say that "EQUAL match for tags should give the same rank as CONTAINS match for name" for example.

Either way, great lib!

/Victor

from match-sorter.

kentcdodds avatar kentcdodds commented on July 26, 2024

Awesome! Thank you for taking the time to share Victor! Want to make an example in codesandbox and share a link in the docs?

from match-sorter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.