Skip to content

Should executing be emitting false as first value ? #157

Open
@c0diq

Description

ReactiveCocoa contract was that the executing observable would emit false as a first value when subscribed to and the command was not executing. This would allow to directly use it in the enabledIf of another opposite action. Instead we have to manually send false which can have side effects if the action is actually executing.

let stopAction = Action<(), ()> { _ in .just(()) }
let startAction = Action<(), ()>(enabledIf: stopAction.startWith(false).not()) { _ in
   .just(())
}

Instead of

let stopAction = Action<(), ()> { _ in .just(()) }
let startAction = Action<(), ()>(enabledIf: stopAction.not()) { _ in
   .just(())
}

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