* 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)
| 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 |
no test coverage detected