e2corporation commented on issue #2744:
URL: 
https://github.com/apache/incubator-devlake/issues/2744#issuecomment-1217469660

   @likyh This particular effect hasn't previously suffered nor does it 
currently suffer from a circular dependency. I do like the idea of having an 
`onConfiguredBoardChange`, though there would be one needed for projects as 
well if that were the case. As JIRA settings are working well at the moment 
there's no problem to solve with transformations. 
   
   To clarify one way on how circular loops happen in an effect, an effect must 
not call the setter on the state variable for which the effect depends on. 
   
   ```
   // Improper Use of Effect
   useEffect(() => {
     setApple(apple)
   }, [apple])
   ```
   
   As far as your refactoring intentions go, first start small and work your 
way up from there.
   
   1. Add Additional Memoizations
   2. Update `StandardStackedList.jsx` if necessary. The whole reason there are 
2 paths `addBoardTransformation` and `addProjectTransformation` is that these 
features could diverge based on product or business requirements. If we needed 
to perform any post-processing before setting the configured project or board, 
it would be done in the `addBoard...` and `addProject..` handlers. This is what 
the `setXXX` handlers are not passed directly.3. 
   
   There's more meaningful work to do if you have time to invest on the 
frontend, such as implementing the Data Models I described, adding Pagination 
feature to Blueprints Grid, restoring Cypress Tests to the stack, and adding a 
Redux store (which I already had plans for and started locally), and more to 
mention.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to