-
Notifications
You must be signed in to change notification settings - Fork 470
Closed
Labels
Description
54 │ [@bs.deriving abstract] type jsProps = {
55 │ isDoNotDisturbEnabled: bool,
56 │ onStatusChange: bool => unit,
57 │ };
58 │
syntactic function type is not allowed when working with abstract bs.deriving, create a named type as work around
This error is thrown when we try to put a function signature in a record with bs.deriving abstract
. This is out of interop currying concerns, but I think this constraint should be removed:
- It's not going to be enforced consistently anyway, since lots of use-cases will be
onStatusChange: Js.nullable(bool => unit)
, which doesn't error - Js objects (especially for UI) tend to contain a lot of callbacks. Aliasing them manually each time becomes very tedious.
- We want to use this on bsb-native, so allowing functions make sense.