cdglabs / apparatus

A hybrid graphics editor and programming environment for creating interactive diagrams.
http://aprt.us/
MIT License
1.04k stars 59 forks source link

small ComputationManager-related refactors #27

Closed joshuahhh closed 8 years ago

joshuahhh commented 8 years ago

Two small changes having to do with ComputationManager:

  1. I found the "if computationManager isn't running, call myself recursively through computationManager.run" pattern to be confusing, so I put that behavior into computationManager.run itself. (This is a safe change unless there's a meaning to calling computationManager.run inside a callback passed to computationManager.run. In fact, I think it's safer than before?)
  2. I switched to a more direct way of using computationManager.memoize.

(Heads up, I made both of these changes while working on a larger Dataflow refactor. That larger refactor may or may not make sense, but these seemed like good changes regardless.)

electronicwhisper commented 8 years ago

OK. Seems like functionality should be the same based on my reading. I am neutral about one being less confusing than the other. I see what you mean that your way is safer. I commend you for understanding this part of the code :stuck_out_tongue_closed_eyes:

If tests pass and it works I'm fine with the change.