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

Add useCollectionService hook #12

Merged
merged 7 commits into from
May 29, 2024

Conversation

daymxn
Copy link
Contributor

@daymxn daymxn commented May 22, 2024

I use a very large portion of the hooks present in this repo, so I thought I might as well give back one of my own; one that seemed like it could be of some common use.

This PR adds a hook called useCollectionService that takes in a param tag: string. It will keep track of instances added and removed under the given tag, and return it in a stateful array.

This PR also includes a README.md and tests for the added hook.

Also, I'm not completely set on the name. If you have alternative proposals, I'm open to them. Some alternative I thought of were:

  • useTagged / useTag => very valid alternative name
  • useInstances => doesn't really convey the tag usage- and also conflicts with certain libraries, I'm pretty sure.

@littensy littensy added the enhancement New feature or request label May 22, 2024
@littensy littensy merged commit 8e62b0d into littensy:master May 29, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants