You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 3, 2024. It is now read-only.
so now we can run our effects anywhere we want.
what is wrong with this code? say we animate something using jQuery inside our reducer then calling exec inside it or calling an API then after that call exec when the data received,
so you implement a library that everywhere in the codebase you can call useEffect.
do you know how much effort the React team has done so you can't use effects this way?
I think it is better that every action or side effect will be wrapped inside a Task monad or something like that so the reducer will return a tuple of state and effects
also, the reducer is not pure as I said in twitter and you blocked me, I hope you understand that you are an influencer in this community and saying something that is not correct make other people like me in a mistake.
nevertheless, I'm sorry if my behavior was not appropriate I was just wanted to inform you and others like me that our reducer function is not pure.
The text was updated successfully, but these errors were encountered:
The internal implementation of the reducer is pure, as I have explained. The "effect reducer" might not seem pure, but it is not used directly - it is wrapped by a pure reducer that does not execute side-effects; it only captures them.
Please write a failing test if there is an issue with this implementation.
the whole library wants to do something like this
but the React will raise error for this piece of code, cause you should not use hooks this way,
so we can add all functions with effect inside a list
so now we can run our effects anywhere we want.
what is wrong with this code? say we animate something using jQuery inside our reducer then calling exec inside it or calling an API then after that call
exec
when the data received,so you implement a library that everywhere in the codebase you can call
useEffect
.do you know how much effort the React team has done so you can't use effects this way?
I think it is better that every action or side effect will be wrapped inside a Task monad or something like that so the reducer will return a tuple of
state
andeffects
also, the reducer is not pure as I said in twitter and you blocked me, I hope you understand that you are an influencer in this community and saying something that is not correct make other people like me in a mistake.
nevertheless, I'm sorry if my behavior was not appropriate I was just wanted to inform you and others like me that our reducer function is not pure.
The text was updated successfully, but these errors were encountered: