Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@vouillon
Copy link
Member

This avoids a failure when some inputs cannot be compared (if they contain functional values, for instance).
We need to do something anyway if one of the inputs changes, so it makes sense to use physical equality here.

This avoids a failure when some inputs cannot be compared structurally
(if they contain functional values, for instance).

Internally, Lwt_react.S.l2 is implemented using React.S.l2 and
Lwt_react.S.map_s. We were not providing an equality function to
React.S.l2, so the default structural equality was used. Now, we use the
function (fun _ _ -> false). So, the function parameter is applied each
time any of the input change, which is exactly what we would expect if
we implemented Lwt_react.S.map_s directly.
@vouillon vouillon changed the title Lwt_react: use physical equality internally to implement S.l[2-6]_s Lwt_react: no longer compare structurally the inputs of S.l[2-6]_s Oct 28, 2021
@raphael-proust raphael-proust merged commit b88ed83 into master Nov 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants