Skip to content

Async state updates are first-write-wins #15

@ul

Description

@ul

See https://github.com/clayrat/opticui-elm-architecture/blob/master/src/6ViewerPair.purs#L46 for the concrete example. viewer has an async initializer, which makes AJAX request and then updates state. If I understand correctly how optic-ui works, when two or more viewers are rendered on the page then the fastest response updates application state and generation counter. Any other async handler which was run in the same generation fails to update state because of generation check https://github.com/zrho/purescript-optic-ui/blob/master/src/OpticUI/Run.purs#L53

Of course, if we will just remove generation check, situation will turn to last-write-wins, which is unacceptable too. We need to make async handlers composable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions