mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-17 15:53:28 +00:00
update group in real time (#7141)
This commit is contained in:
@@ -3,6 +3,11 @@ export const EVENT_BUS_TYPE = {
|
||||
CURRENT_LIBRARY_CHANGED: 'current_library_changed',
|
||||
SEARCH_LIBRARY_CONTENT: 'search_library_content',
|
||||
|
||||
// group
|
||||
ADD_NEW_GROUP: 'add_new_group',
|
||||
ADD_SHARED_REPO_INO_GROUP: 'add_shared_repo_into_group',
|
||||
UNSHARE_REPO_TO_GROUP: 'unshare_repo_to_group',
|
||||
|
||||
RESTORE_IMAGE: 'restore_image',
|
||||
OPEN_MARKDOWN: 'open_markdown',
|
||||
};
|
||||
|
@@ -1,5 +1,16 @@
|
||||
class EventBus {
|
||||
subscribers = {};
|
||||
|
||||
constructor() {
|
||||
this.instance = null;
|
||||
this.subscribers = {};
|
||||
}
|
||||
|
||||
static getInstance() {
|
||||
if (this.instance) return this.instance;
|
||||
this.instance = new EventBus();
|
||||
return this.instance;
|
||||
}
|
||||
|
||||
|
||||
subscribe(type, handler) {
|
||||
if (!this.subscribers[type]) {
|
||||
|
Reference in New Issue
Block a user