Skip to content

Add type-safe InvokeCommandSafe without ICommand overloads. #2837

Open
@HavenDV

Description

@HavenDV

Now, when changing command parameters without explicitly specifying the types of arguments, the InvokeCommand (ICommand) overload is called, which ignores the input type and throws an exception only during runtime.

// this throws runtime exception
_ = Observable<Input>()
    .Select(_ => OtherTypeInput)
    .InvokeCommand(Command);

// this throws compile time exception
_ = Observable<Input>()
    .Select(_ => OtherTypeInput)
    .InvokeCommand<Input, Output>(Command);

// should throw compile time exception
_ = Observable<Input>()
    .Select(_ => OtherTypeInput)
    .InvokeCommandSafe(Command);

other suggested names: InvokeReactiveCommand

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions