Event Emitter

We don’t want to use a setTimeout() call in our test, so we’re setting up our production RealTimeServer class to emit an event when it receives a client event. We’re able to test-drive this without too much trouble. Then it’s time to replace our setTimeout() code with the new event code.

comments powered by Disqus