Skip to content

ReactiveCommand with running scheduler (not output scheduler) #347

@Micha-kun

Description

@Micha-kun

This is primarily related to Task Commands, but maybe other commands could benefit from this. When I'm creating Task Commands, because I try to run on background thread always, I'm "polluting" every command with Task.Run envelopes around my real code. It would be interesting if ReactiveCommand attribute via Source Generators could generate that envelope to force the running of the code inside a Task.Run (using, for example, ForceTaskRun = true, by default false) or maybe better, a property like RunningScheduler that runs all the command code in that scheduler (by default null or RxApp.MainThreadScheduler).

What do you think?

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