dijon
dijon copied to clipboard
added mapCommand, unmapCommand APIs
I thought this would be a good contribution to the API in that it adds functionality much like RobotLeg's command, event bus paradigm.
Thanks for the PR, but to be honest I'm not entirely sure whether this is useful... Personally I just map command functions as handlers and do not see the benefit of making them constructable, but YMMV. Do you know of any added benefits to making "classes" with execute functions instead of using plain functions?
I think the encapsulation of the execute, result and error handlers within a "class" or module is beneficial. Otherwise you're having to have awareness of those handlers elsewhere.
Of course this is a moot point if you are just nesting anonymous functions, something I generally try to avoid. On May 11, 2014 9:52 AM, "creynders" [email protected] wrote:
Thanks for the PR, but to be honest I'm not entirely sure whether this is useful... Personally I just map command functions as handlers and do not see the benefit of making them constructable, but YMMV. Do you know of any added benefits to making "classes" with execute functions instead of using plain functions?
— Reply to this email directly or view it on GitHubhttps://github.com/creynders/dijon/pull/4#issuecomment-42771071 .