These are chat archives for jdubray/sam

4th
Dec 2017
Marcus Feitoza
@mfeitoza
Dec 04 2017 01:26
@jdubray I you don't make some screencast for egghead or scrimba?
Jean-Jacques Dubray
@jdubray
Dec 04 2017 02:11
No, this year has been difficult health wise and as of two weeks ago I had difficulty to speak. I feel a bit better, but I still cannot speak much more than two/three hours per day.
Jean-Jacques Dubray
@jdubray
Dec 04 2017 16:49
@foxdonut @victornoel just to go back on the topic of globals. Just to be clear, as Fred pointed out, SAM only requires one global variable. All the actions are then "mounted" onto that variable. The variable itself could be a parameter passed to the SAM instance during instantiation. I don't want to use "addEventListener" because I feel that's much worse having to mount manually all event handlers. Is that what you would prefer?
Fred Daoud
@foxdonut
Dec 04 2017 17:01
@jdubray I was not suggesting addEventListener. I prefer onclick="${something}"
Jean-Jacques Dubray
@jdubray
Dec 04 2017 17:20
@foxdonut but what is the underlying mechanism? All frameworks convert this kind of syntax to one of the two: global variable or addEventListener.
Fred Daoud
@foxdonut
Dec 04 2017 18:11
@jdubray neither. the library works with DOM nodes in JS, so for example it will assign domNode.onclick = something and something is a local function, not a global variable.