ore-ui
ore-ui copied to clipboard
Instantiable Shared Facets
Implements RFC https://github.com/Mojang/ore-ui/issues/65, with some caveats.
Notes:
- [x] Deduplication (calling the driver only once for the same path) is missing
- [ ]
onErrorcallback is not supported (currently not used, so it should be safe to skip) - [ ]
defaultValueargument is no longer supported - [ ] What should be done with the
useSharedFacetPropSetter? It might be best to apply to regularFacets rather thanSharedFacets specifically now. I renamed it accordingly touseFacetPropSetter
If we wanted to support onError callback or default value, we would have to add a first argument with an options object, or make sure that useSharedFacet is not variadic and accepts a tuple with the path instead. It seems neither a default value nor the onError handler were required as per the RFC. I did not manage to make the types work with an tuple, so I opted for a variadic API for now.