AS a package user, I want to be able to interact with the "sortBy" variable using pre-defined string types #76
Labels
No labels
blocked
documentation
duplicate
enhancement
good first issue
help wanted
invalid
needs criteria
needs estimate
needs tests
question
spike
type
admin
type
alert
type
bug
type
defect
type
dependencies
type
epic
type
investigation
type
story
wontfix
blocked
duplicate
needs criteria
needs designs
needs estimate
needs testing
question
type
admin
type
alert
type
bug
type
defect
type
dependencies
type
design
type
documentation
type
epic
type
incident
type
investigation
type
spike
type
story
won't fix
No project
No assignees
2 participants
Notifications
Total time spent: 5 minutes
Due date
VylpesTester
5 minutes
No due date set.
Dependencies
No dependencies set.
Reference: RabbitLabs/random-bunny#76
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Epic:
Story Points: 1
AS a package user, I want to be able to interact with the "sortBy" variable using pre-defined string types
SO THAT I can easily use a pre-defined list and know it exists
Acceptance Criteria
AS a package user
GIVEN I'm using the package in TypeScript
WHEN I specify the "sortBy" parameter
THEN the type should only let me use the strings of the allowed values
AS a package user
GIVEN I'm using the package in JavaScript
WHEN I specify the "sortBy" parameter
THEN it should still work with a string
AND validation will be done as previously
Subtasks
Notes
No notes
Make "sortBy" variable an enumto AS a package user, I want to be able to interact with the "sortBy" variable using an enumCan enums be defined as strings? This might be helpful to do if so, if not we should make the type string OR enum, so we can interact with it like how it is right now (no change in API)
Would we be better off not making it an enum and instead enforce string names in typescript? E.g.
sortBy: "hot" | "new"
Yeah, I prefer this choice
AS a package user, I want to be able to interact with the "sortBy" variable using an enumto AS a package user, I want to be able to interact with the "sortBy" variable using pre-defined string typesThis has passed testing, the variable now errors when its not valid