[x] Deduplication (calling the driver only once for the same path) is missing
[ ] onError callback is not supported (currently not used, so it should be safe to skip)
[ ] defaultValue argument is no longer supported
[ ] What should be done with the useSharedFacetPropSetter? It might be best to apply to regular Facets rather than SharedFacets specifically now. I renamed it accordingly to useFacetPropSetter
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.
Implements RFC https://github.com/Mojang/ore-ui/issues/65, with some caveats.
Notes:
onError
callback is not supported (currently not used, so it should be safe to skip)defaultValue
argument is no longer supporteduseSharedFacetPropSetter
? It might be best to apply to regularFacet
s rather thanSharedFacet
s 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 thatuseSharedFacet
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.