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

Delete element from FIFO #3

Open
vanodevium opened this issue Apr 28, 2023 · 2 comments
Open

Delete element from FIFO #3

vanodevium opened this issue Apr 28, 2023 · 2 comments

Comments

@vanodevium
Copy link

I fully understand how FIFO works, but for my business problem I really need the ability to find an item in the queue and delete it.

Please advise if there is any possibility to do this?

@mafintosh
Copy link
Owner

You'll have to rebuild it, ie shift them all out and readd them minus the deleted ones. In other apps I've built I've used a pattern of simply adding a ".deleted" prop the items in the queue and auto skipping those when shifting assuming you have a reference to the item you want to delete.

@vanodevium
Copy link
Author

The main problem is that I can have 3 million elements and rebuilding each time is a bit expensive.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants