feat(API): updateMessage API for forcing re-renders

This commit is contained in:
Nuckyz 2024-05-29 04:57:18 -03:00
parent 9b9a5322c9
commit 537fc5e33d
No known key found for this signature in database
GPG key ID: 440BF8296E1C4AD9
8 changed files with 106 additions and 20 deletions

View file

@ -41,8 +41,33 @@ export class FluxStore {
__getLocalVars(): Record<string, any>;
}
export class FluxEmitter {
constructor();
changeSentinel: number;
changedStores: Set<FluxStore>;
isBatchEmitting: boolean;
isDispatching: boolean;
isPaused: boolean;
pauseTimer: NodeJS.Timeout | null;
reactChangedStores: Set<FluxStore>;
batched(batch: (...args: any[]) => void): void;
destroy(): void;
emit(): void;
emitNonReactOnce(): void;
emitReactOnce(): void;
getChangeSentinel(): number;
getIsPaused(): boolean;
injectBatchEmitChanges(batch: (...args: any[]) => void): void;
markChanged(store: FluxStore): void;
pause(): void;
resume(): void;
}
export interface Flux {
Store: typeof FluxStore;
Emitter: FluxEmitter;
}
export class WindowStore extends FluxStore {

View file

@ -144,6 +144,7 @@ const persistFilter = filters.byCode("[zustand persist middleware]");
export const { persist: zustandPersist } = findLazy(m => m.persist && persistFilter(m.persist));
export const MessageActions = findByPropsLazy("editMessage", "sendMessage");
export const MessageCache = findByPropsLazy("clearCache", "_channelMessages");
export const UserProfileActions = findByPropsLazy("openUserProfileModal", "closeUserProfileModal");
export const InviteActions = findByPropsLazy("resolveInvite");