UNPKG

livereactload-chrome

Version:

Hot reload all the parts of a chrome extension

21 lines (16 loc) 478 B
'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); exports['default'] = startClient; function startClient(scope, onMsg) { var port = chrome.runtime.connect({ name: '__livereactFwd' }); // Send client options to background script port.postMessage(scope.options); // Listen for changes port.onMessage.addListener(function (msg) { var handle = onMsg[msg.type]; if (handle) handle(msg); }); } module.exports = exports['default'];