lunixbochs/reslate — pull request #11 by rr326 (2014-06-13 16:53:34+00:00)
Title: $.op() - wraps S.op() within S.bind() or S.bindAll()

This works.

But I actually think the better solution is either to fix the bind/bindAll monkeypatching or don't monkeypatch and just create $.bind

## Fix monkeypatching
It think this is the best solution. The monkeypatching, I think, is broken, since it doesn't just improve S.bind / S.bindAll, but actually breaks it. For instance, without reslate, inside a bind you can do `$.op("resize", { "width" : "-10%", "height" : "+0" })`. With reslate installed, that doesn't work. Instead you would have to do:

S.bind('x', function(win){
var tmp=S.op("resize", { "width" : "-10%", "height" : "+0" });
tmp.run();
})

To fix this, the monkeypatching needs to recognize when the passed-in argument is a JSOperationWrapper object. If so, the monkeypatching would then automatically wrap as my $.op() function now does. Unfortunately I couldn't figure out how to do it.

## Create new $.bind() / $.bindAll() functions
If the monkeypatching can't be fixed, then don't monkeypatch - just create new bind/bindAll functions within $. That way, S.bind() accepts standard slate S.op() functions as normal, and $.bind() is explicit that it only accepts $.xx operations (such as $.op()).