Download pool/shard007/JavaScript/0044036_AppCacheStore.js from Variable-role/sajaniemi_variable_dataset_large: direct link, hf CLI and curl.
- Browser
- Download file 998 Bytes
-
https://huggingface.co/datasets/Variable-role/sajaniemi_variable_dataset_large/resolve/main/pool/shard007/JavaScript/0044036_AppCacheStore.js
- Command line
-
hf download hf://datasets/Variable-role/sajaniemi_variable_dataset_large/pool/shard007/JavaScript/0044036_AppCacheStore.js
-
curl -L -o 0044036_AppCacheStore.js https://huggingface.co/datasets/Variable-role/sajaniemi_variable_dataset_large/resolve/main/pool/shard007/JavaScript/0044036_AppCacheStore.js
998 Bytes
| import { EventEmitter } from 'events'; | |
| import ActorAppDispatcher from 'dispatcher/ActorAppDispatcher'; | |
| import { ActionTypes } from 'constants/ActorAppConstants'; | |
| const CHANGE_EVENT = 'change'; | |
| let _isModalOpen = false; | |
| class AppCacheStore extends EventEmitter { | |
| constructor() { | |
| super(); | |
| } | |
| isModalOpen() { | |
| return _isModalOpen; | |
| } | |
| emitChange() { | |
| this.emit(CHANGE_EVENT); | |
| } | |
| addChangeListener(callback) { | |
| this.on(CHANGE_EVENT, callback); | |
| } | |
| removeChangeListener(callback) { | |
| this.removeListener(CHANGE_EVENT, callback); | |
| } | |
| } | |
| let AppCacheStoreInstance = new AppCacheStore(); | |
| AppCacheStoreInstance.dispatchToken = ActorAppDispatcher.register(action => { | |
| switch(action.type) { | |
| case ActionTypes.APP_UPDATE_MODAL_SHOW: | |
| _isModalOpen = true; | |
| break; | |
| case ActionTypes.APP_UPDATE_MODAL_HIDE: | |
| _isModalOpen = false; | |
| break; | |
| default: | |
| return; | |
| } | |
| AppCacheStoreInstance.emitChange(); | |
| }); | |
| export default AppCacheStoreInstance; | |