Extend immutable.Records using es6 classes

This commit is contained in:
Ken-Håvard Lieng 2017-04-22 22:24:11 +02:00
parent dce68ce813
commit 307c83958a
1 changed files with 6 additions and 4 deletions

View File

@ -3,14 +3,16 @@ import { LOCATION_CHANGE } from 'react-router-redux';
import createReducer from '../util/createReducer'; import createReducer from '../util/createReducer';
import * as actions from '../actions'; import * as actions from '../actions';
const Tab = Record({ const TabRecord = Record({
server: null, server: null,
name: null name: null
}); });
Tab.prototype.isChannel = function isChannel() { class Tab extends TabRecord {
return this.name && this.name.charAt(0) === '#'; isChannel() {
}; return this.name && this.name.charAt(0) === '#';
}
}
const State = Record({ const State = Record({
selected: new Tab(), selected: new Tab(),