FokkeZB / nl.fokkezb.loading

The widget provides a simple loading mask that can be easily styled and configured.
93 stars 18 forks source link

Adding the test for the success() function in the example app. #34

Closed clemblanco closed 6 years ago

FokkeZB commented 8 years ago

@Claymm thanks, may I ask why you used named function expression? Because of how Alloy compiles the controller this is less efficient (it'll test for the availability to bind the UI callbacks twice)

clemblanco commented 8 years ago

I wasn't aware about that. I just found it "sexier" to look at. :) So a simple and normal function foo() { return 'bar'; } is actually more efficient? How much more efficient?

FokkeZB commented 8 years ago

Not a lot, but right after creating the UI element it'll do:

global ? $.addListener($.__views.__alloyId0, "click", global) : __defers["$.__views.__alloyId0!click!global"] = true;

And since global is not hoisted it wil push to the __defers array which will later be used for:

__defers["$.__views.__alloyId0!click!global"] && $.addListener($.__views.__alloyId0, "click", global);

So it uses some memory and does an additional check.

clemblanco commented 8 years ago

Fair enough. I'll change it back again then.

FokkeZB commented 8 years ago

Not very relevant for this test/sample of course, just curious why you did it :)

FokkeZB commented 6 years ago

Closing for inactivity