A Work in Progress

developer's blog by Wei
lots of work in progress notes

When to Do What

November 06, 2019


  • where do we place certain code

    • according to business feature - code organization, abstract thinking
    • according to browser, web standards, native apis, react life cycle - nature of task


chances where we can throw in some JavaScript

the categorization not entirely accurate


  • <head></head> tag
  • <body></body> tag
  • when do the above run varies drastly based on where the tag is placed, whether async or defer or not


  • in each JS file (before writing any react code)

react lifecycle

  • render function before return (yah, we ignoring class components for now)
  • useEffect - when do they run?
  • useCallback - when do they run?

outside of react (but consumed by components)

  • (around) apis calls
  • reducers