ConsoleShortcuts: add Stores
map with all stores
This commit is contained in:
parent
2f4e346e26
commit
ca810250d1
2 changed files with 11 additions and 1 deletions
|
@ -141,7 +141,15 @@ function makeShortcuts() {
|
|||
guildId: { getter: () => Common.SelectedGuildStore.getGuildId(), preload: false },
|
||||
me: { getter: () => Common.UserStore.getCurrentUser(), preload: false },
|
||||
meId: { getter: () => Common.UserStore.getCurrentUser().id, preload: false },
|
||||
messages: { getter: () => Common.MessageStore.getMessages(Common.SelectedChannelStore.getChannelId()), preload: false }
|
||||
messages: { getter: () => Common.MessageStore.getMessages(Common.SelectedChannelStore.getChannelId()), preload: false },
|
||||
|
||||
Stores: {
|
||||
getter: () => Object.fromEntries(
|
||||
Common.Flux.Store.getAll()
|
||||
.map(store => [store.getName(), store] as const)
|
||||
.filter(([name]) => name.length > 1)
|
||||
)
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
|
2
src/webpack/common/types/stores.d.ts
vendored
2
src/webpack/common/types/stores.d.ts
vendored
|
@ -39,6 +39,8 @@ export class FluxStore {
|
|||
syncWith: GenericFunction;
|
||||
waitFor: GenericFunction;
|
||||
__getLocalVars(): Record<string, any>;
|
||||
|
||||
static getAll(): FluxStore[];
|
||||
}
|
||||
|
||||
export class FluxEmitter {
|
||||
|
|
Loading…
Reference in a new issue