* Register callback function for message with type messageType. * @param {string} messageType The type of the message. * @param {function(?JsonObject)} callback The callback function to call * when a message with type messageType is received. * @return {function()}
(messageType, callback)
| 103 | * @return {function()} |
| 104 | */ |
| 105 | registerCallback(messageType, callback) { |
| 106 | // NOTE : no validation done here. any callback can be register |
| 107 | // for any callback, and then if that message is received, this |
| 108 | // class *will execute* that callback |
| 109 | return this.getOrCreateObservableFor_(messageType).add(callback); |
| 110 | } |
| 111 | |
| 112 | /** |
| 113 | * Send a postMessage to Host Window, or all parent windows if host window is |
no test coverage detected