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

Assigned Collections #9

Open
doubleactii opened this issue Oct 26, 2023 · 1 comment
Open

Assigned Collections #9

doubleactii opened this issue Oct 26, 2023 · 1 comment
Assignees

Comments

@doubleactii
Copy link
Member

Allow users to assign arrays that will belong to the collector.

This will allow users to use arrays across multiple files, and will make it so the array doesn't have to be global.

const collection = [1, 2, 3];
Collector.registerCollection('nameOfCollection', collection);
// Now you can do
Collector.nameOfCollection // [1, 2, 3]

This will be foolproof and won't allow multiple collections to be referenced to the same name of course.
This will also allow collections to be deregistered.

Collector.deregisterCollection('nameOfCollection');
// Now when referencing the collection
Collector.nameOfCollection // undefined

This will be foolproof and will only deregister collections that exist.

Will need to keep a array of tracked collections.

@doubleactii doubleactii self-assigned this Oct 26, 2023
@doubleactii
Copy link
Member Author

This API won't directly attach a variable to the Collector class. Instead it will provide an API to retrieve a collection that has been registered to it.

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

1 participant