(value)
| 41 | }; |
| 42 | |
| 43 | function createEventEmitter(value) { |
| 44 | let handlers = []; |
| 45 | return { |
| 46 | on(handler) { |
| 47 | handlers.push(handler); |
| 48 | }, |
| 49 | |
| 50 | off(handler) { |
| 51 | handlers = handlers.filter(h => h !== handler); |
| 52 | }, |
| 53 | |
| 54 | get() { |
| 55 | return value; |
| 56 | }, |
| 57 | |
| 58 | set(newValue, changedBits) { |
| 59 | value = newValue; |
| 60 | handlers.forEach(handler => handler(value, changedBits)); |
| 61 | } |
| 62 | }; |
| 63 | } |
| 64 | |
| 65 | function onlyChild(children): any { |
| 66 | return Array.isArray(children) ? children[0] : children; |
no outgoing calls
no test coverage detected
searching dependent graphs…