Extend immutable.Records using es6 classes
This commit is contained in:
parent
dce68ce813
commit
307c83958a
|
@ -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(),
|
||||||
|
|
Loading…
Reference in New Issue