Skip to content

think about associated data when started #11

Closed
@weissi

Description

@weissi

Manual state tracking has the advantage that you're able to associate data with a state. For example

enum LifecycleState {
    case stopped
    case started(Channel)
    case stopping(Channel)
}

migrating this to Lifecycle currently would require to add an optional

var serverChannel: Channel?

and then the code would start to contain self.serverChannel!. The other option is to duplicate the state tracking in Lifecycle as well as the application but that's not nice either because the states can get out of sync.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions