MCPcopy
hub / github.com/anthonyshort/deku / addEvent

Function addEvent

lib/render.js:1157–1166  ·  view source on GitHub ↗

* Bind events for an element, and all it's rendered child elements. * * @param {String} path * @param {String} event * @param {Function} fn

(entityId, path, eventType, fn)

Source from the content-addressed store, hash-verified

1155 */
1156
1157 function addEvent (entityId, path, eventType, fn) {
1158 keypath.set(handlers, [entityId, path, eventType], function (e) {
1159 var entity = entities[entityId]
1160 if (entity) {
1161 return fn(e, entity.context, setState(entity))
1162 } else {
1163 return fn(e)
1164 }
1165 })
1166 }
1167
1168 /**
1169 * Unbind events for a entityId

Callers 1

setAttributeFunction · 0.85

Calls 2

setStateFunction · 0.85
setMethod · 0.80

Tested by

no test coverage detected