diff options
author | Christopher Speller <crspeller@gmail.com> | 2017-09-06 23:04:13 -0700 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2017-09-06 23:11:58 -0700 |
commit | d8bd57901e33a7057e26e782e295099ffcc0da89 (patch) | |
tree | e12dfc8cad42b1576756d19d7fbfd82646a009bf /webapp/stores/analytics_store.jsx | |
parent | 7bc8e9a08dfde56387f946fdf5086252aa4d0491 (diff) | |
download | chat-d8bd57901e33a7057e26e782e295099ffcc0da89.tar.gz chat-d8bd57901e33a7057e26e782e295099ffcc0da89.tar.bz2 chat-d8bd57901e33a7057e26e782e295099ffcc0da89.zip |
Removing webapp
Diffstat (limited to 'webapp/stores/analytics_store.jsx')
-rw-r--r-- | webapp/stores/analytics_store.jsx | 58 |
1 files changed, 0 insertions, 58 deletions
diff --git a/webapp/stores/analytics_store.jsx b/webapp/stores/analytics_store.jsx deleted file mode 100644 index 63c8a5bee..000000000 --- a/webapp/stores/analytics_store.jsx +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -import EventEmitter from 'events'; - -const CHANGE_EVENT = 'change'; - -import store from 'stores/redux_store.jsx'; - -class AnalyticsStoreClass extends EventEmitter { - constructor() { - super(); - - this.entities = {}; - - store.subscribe(() => { - const newEntities = store.getState().entities.admin; - - if (newEntities.analytics !== this.entities.analytics) { - this.emitChange(); - } - - if (newEntities.teamAnalytics !== this.entities.teamAnalytics) { - this.emitChange(); - } - - this.entities = newEntities; - }); - } - - emitChange() { - this.emit(CHANGE_EVENT); - } - - addChangeListener(callback) { - this.on(CHANGE_EVENT, callback); - } - - removeChangeListener(callback) { - this.removeListener(CHANGE_EVENT, callback); - } - - getAllSystem() { - return JSON.parse(JSON.stringify(store.getState().entities.admin.analytics)); - } - - getAllTeam(id) { - const teamStats = store.getState().entities.admin.teamAnalytics[id]; - if (teamStats) { - return JSON.parse(JSON.stringify(teamStats)); - } - - return {}; - } -} - -var AnalyticsStore = new AnalyticsStoreClass(); -export default AnalyticsStore; |