Skip to content
This repository has been archived by the owner on Jul 23, 2021. It is now read-only.

Feature request: Priority queue / self-sorting list [can PR] #181

Open
Methuselah96 opened this issue Oct 17, 2020 · 1 comment
Open

Feature request: Priority queue / self-sorting list [can PR] #181

Methuselah96 opened this issue Oct 17, 2020 · 1 comment
Labels
enhancement New feature or request from-original-repo

Comments

@Methuselah96
Copy link

From @mcclure on Thu, 08 Oct 2020 05:15:11 GMT

Hi, I have a need for a "priority queue" style data structure, or more specifically I need an immutable structure that I can add items to in arbitrary order and then repeatedly efficiently iterate over according to some fixed property (for example if I have a list of objects obj, I might want to keep it sorted by the key obj.date).

I need this enough I plan to attempt an implementation myself. I would be happy to write a PR if there is a specific way I could write it that you would be willing to accept.

I find a number of algorithms online for immutable priority queues, but it seems like it might be a good idea to base my implementation on the existing list structure rather than implementing a totally new structure. For this reason I am curious if there is any "contributor documentation" that would help me understand the underlying principles of immutable.js List. I am pawing through the source but not having much luck understanding where the important parts are. List.js seems to be describing something like a linked list but each node has this "array" member rather than a next reference and I'm not sure what "array" contains.

Copied from original issue: immutable-js#1791

@mcclure
Copy link

mcclure commented Oct 17, 2020

I am readying a PR for this, I will probably drop similar PRs on top of this + original immutablejs repo.

@Methuselah96 Methuselah96 added the enhancement New feature or request label Oct 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request from-original-repo
Projects
None yet
Development

No branches or pull requests

2 participants