krisk / Fuse

Lightweight fuzzy-search, in JavaScript
https://fusejs.io/
Apache License 2.0
17.89k stars 759 forks source link

Callback in search items? #496

Closed jfuehner closed 3 years ago

jfuehner commented 3 years ago

I was curious if it is possible to include a function in the array of items that is passed to the Fuse constructor?

[
  {
    "title": "Old Man's War",
    "author": {
      "firstName": "John",
      "lastName": "Scalzi",
      click: function() {
    console.log("test");
  }
    }
  },
...
]

I attempted this using the Fuse demo but the function was stripped out of the results displayed...

krisk commented 3 years ago

No, that's not possible. The list is serialized into an index for simpler and speedier processing.

github-actions[bot] commented 3 years ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days