-
Notifications
You must be signed in to change notification settings - Fork 641
Open
Labels
enhancementPossible enhancementPossible enhancementhelp/PR welcomeHelp/Pull request from contributors to fix the issue is welcomeHelp/Pull request from contributors to fix the issue is welcomelevel: easy
Description
For some reason numbers are not allowed in enumerations:
const ordersRequest = types.model({
paymentPeriod: types.optional(types.array(types.enumeration('PaymentPeriod', [15, 30])), [15]),
})
i.e. for a type like: (15 | 30)[]
.
As far as I understand, I have to use types.union
for this:
const ordersRequest = types.model({
paymentPeriod: types.optional(types.array(types.union(types.literal(15), types.literal(30))), [15]),
})
Can numbers be added to enumerations?
Metadata
Metadata
Assignees
Labels
enhancementPossible enhancementPossible enhancementhelp/PR welcomeHelp/Pull request from contributors to fix the issue is welcomeHelp/Pull request from contributors to fix the issue is welcomelevel: easy