Closed ghost closed 9 years ago
It's recommended to use the @handles
decorator anyway if you're using at least Babel stage 1.
@taion Thanks for the cool tip, did not know about this decorator.
Well, it's not documented... yet.
Does that work for your use case?
Certainly! Ditching now all my handlers in favor of the new decorator. So I guess my initial ask becomes irrelevant now.
Here is an annoying suggestion ;) Could you consider reversing the order of data we need pass to this.handlers in the store? So instead of this.handlers = {methodName: actionName}, you would write this.handlers = {actionName: this.methodName}. I know it's painful to change this, so maybe a new method could be introduced (e.g. like bindActions in fluxxor).
There are couple of reasons:
I know you will then lose the possibility to bind the same handler to multiple events using an array as a value, but I would rather duplicate the binding for each action.