title: useEffect alternate for Class Component
body: <p>I just learned that in functional components I can use <code>useEffect</code> to keep an eye on any side effect (ex: when using <code>localStorage</code>) which makes sure my state is hooked up with the effect. </p>
  
  <p>I want to have similar functionality in my class based Component for <code>localStorage</code>. How can I make sure that my state updates itself as soon as there is any change into the <code>localStorage</code>?</p>