vigetlabs / microcosm

Flux with actions at center stage. Write optimistic updates, cancel requests, and track changes with ease.

Home Page:http://code.viget.com/microcosm/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add warning when a repo pushes an action after it has torn down

nhunzaker opened this issue · comments

Basically, if a presenter tears down, I want to help identify any mistakes cleaning them up:

class Counter extends Presenter {
  setup(repo) {
    setInterval(repo.prepare('count'), 1000)
  }
}

ReactDOM.render(<Counter />, root) 
// count.... count.... count

ReactDOM.unmountComponentAtNode(root) 
// Error! This Microcosm has already shut down. Did you forget to clean something up?

Nailed it in #394