Add post list container to hold mounted post lists for faster rendering/channel switching.
Этот коммит содержится в:
@@ -10,6 +10,7 @@ var ActionTypes = Constants.ActionTypes;
|
||||
var BrowserStore = require('../stores/browser_store.jsx');
|
||||
|
||||
var CHANGE_EVENT = 'change';
|
||||
var LEAVE_EVENT = 'leave';
|
||||
var MORE_CHANGE_EVENT = 'change';
|
||||
var EXTRA_INFO_EVENT = 'extra_info';
|
||||
|
||||
@@ -48,6 +49,15 @@ class ChannelStoreClass extends EventEmitter {
|
||||
removeExtraInfoChangeListener(callback) {
|
||||
this.removeListener(EXTRA_INFO_EVENT, callback);
|
||||
}
|
||||
emitLeave(id) {
|
||||
this.emit(LEAVE_EVENT, id);
|
||||
}
|
||||
addLeaveListener(callback) {
|
||||
this.on(LEAVE_EVENT, callback);
|
||||
}
|
||||
removeLeaveListener(callback) {
|
||||
this.removeListener(LEAVE_EVENT, callback);
|
||||
}
|
||||
findFirstBy(field, value) {
|
||||
var channels = this.pGetChannels();
|
||||
for (var i = 0; i < channels.length; i++) {
|
||||
@@ -272,6 +282,10 @@ ChannelStore.dispatchToken = AppDispatcher.register(function handleAction(payloa
|
||||
ChannelStore.emitExtraInfoChange();
|
||||
break;
|
||||
|
||||
case ActionTypes.LEAVE_CHANNEL:
|
||||
ChannelStore.emitLeave(action.id);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user