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
Event or effect calls inside reducers or other supposed-to-be-pure functions like fn of sample or combine rule is a violation of current declared rules of effector, because it makes those functions calls observable "from the outside"
So code like this is technically wrong:
// this code must be either rewritten to operators or written in the same way, but inside `.watch`$store.on(someEvent,(state,payload)=>{// store reducer meant to update stored valueif(payload.some){// but there is some control flow happening instead, which is wrongsomeEffect(state)}else{someOtherEvent(payload)}// next state is never returned - plain wrong usage of `.on`})
Even though effector still can handle that, breaking this rule may lead to problems in next releases of effector
It looks like that check for such calls at the core adds more issues than profit (see: effector/effector#541 (comment)), so eslint-rule is preferred
The text was updated successfully, but these errors were encountered:
Event or effect calls inside reducers or other supposed-to-be-pure functions like
fn
of sample or combine rule is a violation of current declared rules ofeffector
, because it makes those functions calls observable "from the outside"So code like this is technically wrong:
Even though
effector
still can handle that, breaking this rule may lead to problems in next releases of effectorIt looks like that check for such calls at the core adds more issues than profit (see: effector/effector#541 (comment)), so eslint-rule is preferred
The text was updated successfully, but these errors were encountered: