* Register callbacks for option events and watchers. * * @param {Vue} vm * @param {String} action * @param {Object} hash
(vm, action, hash)
| 8122 | */ |
| 8123 | |
| 8124 | function registerCallbacks(vm, action, hash) { |
| 8125 | if (!hash) return; |
| 8126 | var handlers, key, i, j; |
| 8127 | for (key in hash) { |
| 8128 | handlers = hash[key]; |
| 8129 | if (isArray(handlers)) { |
| 8130 | for (i = 0, j = handlers.length; i < j; i++) { |
| 8131 | register(vm, action, key, handlers[i]); |
| 8132 | } |
| 8133 | } else { |
| 8134 | register(vm, action, key, handlers); |
| 8135 | } |
| 8136 | } |
| 8137 | } |
| 8138 | |
| 8139 | /** |
| 8140 | * Helper to register an event/watch callback. |
no test coverage detected