8000 None of the duplicate subscriptions should be started · Issue #258 · elmish/elmish · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
None of the duplicate subscriptions should be started #258
Open
@kspeakman

Description

@kspeakman

Description

When there are multiple subscriptions with the same ID, Elmish subscription logic will start the first one and emit an error on the subsequent duplicates. I propose that it would be better if none of the duplicates were started.

With "first one wins", the runtime behavior can be very confusing. Especially because subs may be turned on or off from model changes. For example:

sub1 and sub2 have the same sub ID

event sub1 sub2 result
startup - on sub2 started
sub1 on on on sub2 stays running, error emitted
sub2 off on - sub2 stays running

-vs-

Nobody wins

event sub1 sub2 result
startup - on sub2 started
sub1 on on on sub2 stopped, error emitted
sub2 off on - sub1 started

I believe the latter scenario will bring the the issue to the dev's attention more quickly. In fact, I fear the current behavior could cause novel UI behaviors that distract the dev from finding the issue.

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

      0