Skip to content
This repository was archived by the owner on Oct 31, 2021. It is now read-only.
This repository was archived by the owner on Oct 31, 2021. It is now read-only.

Separate events instead of discriminated unions? #25

@cmeeren

Description

@cmeeren

I know this is an old library by now, but it still appeared high up on the search results, so here I am.

I'm learning F# (so all of the below may be based on misunderstandings) and I want to use F# for a Xamarin app. Your MVC way of thinking as described in your series seems to have a lot of merit. However, I'm a bit fuzzy on why you have a single event stream per MVC-combo where all the different events are separate cases of a single discriminated union. As far as I can see, this precludes easy Rx manipulation of the different events.

For example, say you have two events for a view: MouseMoved and ButtonClicked. According to your architecture, these would then be two cases of a discriminated union. But if you want to e.g. throttle MouseMoved, or filter it based on coordinates, I can't see an elegant way of doing this. If the two events were instead two different IObservables, this would be trivial.

My two questions:

  1. Do you have any comment on this?

  2. Would you say your MVC solution is still relevant, or are there better ways of solving things nowadays?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions