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.
See https://github.com/clayrat/opticui-elm-architecture/blob/master/src/6ViewerPair.purs#L46 for the concrete example.
viewerhas an async initializer, which makes AJAX request and then updates state. If I understand correctly how optic-ui works, when two or moreviewers 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#L53Of 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.