Hacker News new | ask | show | jobs
by ricardobeat 4874 days ago
Isn't that glue going to fall apart when you start working with asynchronous methods? I might be suffering from tunnel vision, but IMO this is asking for an evented model:

    class Glue
      constructor: (@useCase, @gui, @storage)->
        @useCase.on
            askForName   : @gui.showAskForName
            nameProvided : @gui.hideAskForName
            greetUser    : @gui.showGreetMessage
            restart      : @gui.hideGreetMessage
        @gui.on
            restartClicked : @useCase.restart
            confirmName    : @useCase.nameProvided
1 comments

We use Around in such cases - it can put original method call to callback of asynchronous method.