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 * 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(),