From 39427839b9e253c640307d057f82dd897e44a731 Mon Sep 17 00:00:00 2001 From: Luke Barnard Date: Wed, 1 Mar 2017 14:33:25 +0000 Subject: [PATCH] Use ES6 export style --- src/UnknownDeviceErrorHandler.js | 21 ++++++++++----------- src/components/structures/MatrixChat.js | 2 +- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/src/UnknownDeviceErrorHandler.js b/src/UnknownDeviceErrorHandler.js index c5a3870f40..88f4f57fe4 100644 --- a/src/UnknownDeviceErrorHandler.js +++ b/src/UnknownDeviceErrorHandler.js @@ -19,14 +19,13 @@ const onAction = function(payload) { let ref = null; -module.exports = { - startListening: function () { - ref = dis.register(onAction); - }, - stopListening: function () { - if (ref){ - dis.unregister(ref); - ref = null; - } - }, -}; +export function startListening () { + ref = dis.register(onAction); +} + +export function stopListening () { + if (ref) { + dis.unregister(ref); + ref = null; + } +} diff --git a/src/components/structures/MatrixChat.js b/src/components/structures/MatrixChat.js index 49b700df01..eb5447b822 100644 --- a/src/components/structures/MatrixChat.js +++ b/src/components/structures/MatrixChat.js @@ -41,7 +41,7 @@ var Lifecycle = require('../../Lifecycle'); var PageTypes = require('../../PageTypes'); var createRoom = require("../../createRoom"); -var UDEHandler = require("../../UnknownDeviceErrorHandler"); +import * as UDEHandler from '../../UnknownDeviceErrorHandler'; module.exports = React.createClass({ displayName: 'MatrixChat',