diff options
Diffstat (limited to 'src/webpack/common/internal.tsx')
-rw-r--r-- | src/webpack/common/internal.tsx | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/webpack/common/internal.tsx b/src/webpack/common/internal.tsx index df768f7..e2f42d8 100644 --- a/src/webpack/common/internal.tsx +++ b/src/webpack/common/internal.tsx @@ -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); +} |