Add Circuit.find and findAll methods to replace other get methods #1278
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I'm very much still unsure if this change is worth making, my solution feels hacky but unfortunately it's the only way I found to make it work.
The problem resides in that apparently templated methods like the
find
method cannot be acted on by something likeToDigital
as it will strip it of it's templating. I think this is related to something called "higher kinded types", which is just a fundamental TS limitation.That means each sub-project of the API will have to declare the find/findAll methods explicitly with their types which might not be that big of a deal and we can further make some core utility for typing it explicitly but it's not ... great
If these end up being the only instances of templated methods then it might just simply not be worth the effort but idk.
Not sure it even really cleans up the usage much (at least currently), but theoretically it could allow for some nice fancy querying when the queries are more complex than "get all components".
Thoughts?