Closed aallam closed 4 years ago
For this change I would go for something simple: having two properties
objectID
andobjectIDs
.
Yes I was hesitating about this one, this means moving the error checking from compile-time to runtime (not the best DX IMO), but of course, if you think that the price to pay is too high, then we can go for the two properties solution.
@Aallam Thanks for the PR and I agree with everything that @Ant-hem already said. Just to give you a bit of context here:
Yes I was hesitating about this one, this means moving the error checking from compile-time to runtime (not the best DX IMO), but of course, if you think that the price to pay is too high, then we can go for the two properties solution.
Yes that's very true indeed. However doing that also has its advantages:
Describe your change
Add support of the new field
objectIDs
. The tricky part here is to make this a discriminate union and not just make objectID & objectIDs optional, one of both needs to be set.Note: a less aggressive change can be to simply add a new property with checks and logic operations in the setters, but this can be error-prone IMO.