Notification API (#467)

Co-authored-by: Ven <vendicated@riseup.net>
Co-authored-by: afn <hey@afn.lol>
Co-authored-by: afn <afnzmn@gmail.com>
This commit is contained in:
Ven 2023-02-10 22:33:34 +01:00 committed by GitHub
parent 6114bc6b16
commit 1d995e58f5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
25 changed files with 533 additions and 106 deletions

View file

@ -19,7 +19,7 @@
import { LazyComponent } from "@utils/misc";
// eslint-disable-next-line path-alias/no-relative
import { FilterFn, waitFor } from "../webpack";
import { FilterFn, filters, waitFor } from "../webpack";
export function waitForComponent<T extends React.ComponentType<any> = React.ComponentType<any> & Record<string, any>>(name: string, filter: FilterFn | string | string[]): T {
let myValue: T = function () {
@ -34,3 +34,7 @@ export function waitForComponent<T extends React.ComponentType<any> = React.Comp
return lazyComponent;
}
export function waitForStore(name: string, cb: (v: any) => void) {
waitFor(filters.byStoreName(name), cb);
}