Skip to content

Use discriminated JS return types #11

@velocitysystems

Description

@velocitysystems

Return different object types based on state (e.g., CreatedDownload, ActiveDownload, PausedDownload) with only valid methods.

  • CREATED: start(), cancel()
  • IN_PROGRESS: pause(), cancel()
  • PAUSED: resume(), cancel()
  • CANCELLED: -
  • COMPLETED: -

Metadata

Metadata

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions