Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RFC] Dynamically add/remove items #412

Closed
krisk opened this issue May 3, 2020 · 1 comment
Closed

[RFC] Dynamically add/remove items #412

krisk opened this issue May 3, 2020 · 1 comment
Assignees
Labels
Milestone

Comments

@krisk
Copy link
Owner

krisk commented May 3, 2020

Description

Include the ability to dynamically add items to the search list.

Describe the solution you'd like

API:

  • add: Adds a doc to the end of the index
  • removeAt: Removes the doc at the specified index
add(doc: T): void
removeAt(idx: number): void

Examples:

const fruits = ['apple', 'oranges']
const fuse = new Fuse(fruits)

fuse.add('banana')
// -> fruits:  ['apple', 'oranges', 'banana']

fuse.removeAt(1)
// -> fruits:  ['apple', 'banana']
@krisk krisk added the feature label May 3, 2020
@krisk krisk added this to the v6.0.0 milestone May 3, 2020
@krisk krisk self-assigned this May 3, 2020
@krisk
Copy link
Owner Author

krisk commented May 4, 2020

cc: @amir20, @tomas

@krisk krisk changed the title [RFC] Dynamically add items [RFC] Dynamically add/remove items May 4, 2020
krisk added a commit that referenced this issue May 4, 2020
@krisk krisk closed this as completed May 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant