Commit d63b9d48 authored by Robert Knight's avatar Robert Knight

Replace `module.exports` with ES exports

Change `cross-origin-rpc.js` to use ES exports instead of `module.exports`
for consistency with other modules.

Also update documentation in `service-context.js` to use ES exports.
parent f23e8c8c
...@@ -48,7 +48,7 @@ function isJsonRpcMessage(data) { ...@@ -48,7 +48,7 @@ function isJsonRpcMessage(data) {
* All methods called upon must be mapped in the `registeredMethods` function. * All methods called upon must be mapped in the `registeredMethods` function.
*/ */
// @ngInject // @ngInject
function start(store, settings, $window) { export function startServer(store, settings, $window) {
const methods = registeredMethods(store); const methods = registeredMethods(store);
// Process the pre-start incoming RPC requests // Process the pre-start incoming RPC requests
...@@ -128,11 +128,6 @@ function preStartMessageListener(event) { ...@@ -128,11 +128,6 @@ function preStartMessageListener(event) {
* *
* @param {Window} window_ - Test seam * @param {Window} window_ - Test seam
*/ */
function preStart(window_ = window) { export function preStartServer(window_ = window) {
window_.addEventListener('message', preStartMessageListener); window_.addEventListener('message', preStartMessageListener);
} }
module.exports = {
preStartServer: preStart,
startServer: start,
};
...@@ -52,7 +52,7 @@ export const ServiceContext = createContext(fallbackInjector); ...@@ -52,7 +52,7 @@ export const ServiceContext = createContext(fallbackInjector);
* MyComponent.injectedProps = ['settings'] * MyComponent.injectedProps = ['settings']
* *
* // Wrap `MyComponent` to inject any services it needs. * // Wrap `MyComponent` to inject any services it needs.
* module.exports = withServices(MyComponent); * export default withServices(MyComponent);
*/ */
export function withServices(Component) { export function withServices(Component) {
if (!Component.injectedProps) { if (!Component.injectedProps) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment