From 307c83958acf8f8c7e4c764bb7cbffc9cda36033 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ken-H=C3=A5vard=20Lieng?= Date: Sat, 22 Apr 2017 22:24:11 +0200 Subject: [PATCH] Extend immutable.Records using es6 classes --- client/src/js/reducers/tab.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/client/src/js/reducers/tab.js b/client/src/js/reducers/tab.js index 65f82fcb..b1b04281 100644 --- a/client/src/js/reducers/tab.js +++ b/client/src/js/reducers/tab.js @@ -3,14 +3,16 @@ import { LOCATION_CHANGE } from 'react-router-redux'; import createReducer from '../util/createReducer'; import * as actions from '../actions'; -const Tab = Record({ +const TabRecord = Record({ server: null, name: null }); -Tab.prototype.isChannel = function isChannel() { - return this.name && this.name.charAt(0) === '#'; -}; +class Tab extends TabRecord { + isChannel() { + return this.name && this.name.charAt(0) === '#'; + } +} const State = Record({ selected: new Tab(),