diff --git a/src/webpack/common/stores.ts b/src/webpack/common/stores.ts index b40b7bf2a..71c7989ef 100644 --- a/src/webpack/common/stores.ts +++ b/src/webpack/common/stores.ts @@ -63,7 +63,6 @@ export const DraftStore = findStore("DraftStore"); /** * React hook that returns stateful data for one or more stores * You might need a custom comparator (4th argument) if your store data is an object - * * @param stores The stores to listen to * @param mapper A function that returns the data you need * @param dependencies An array of reactive values which the hook depends on. Use this if your mapper or equality function depends on the value of another hook @@ -71,9 +70,4 @@ export const DraftStore = findStore("DraftStore"); * * @example const user = useStateFromStores([UserStore], () => UserStore.getCurrentUser(), null, (old, current) => old.id === current.id); */ -export const useStateFromStores = find(filters.byProps("useStateFromStores"), m => m.useStateFromStores) as ( - stores: t.FluxStore[], - mapper: () => T, - dependencies?: any[] | null, - isEqual?: (old: T, newer: T) => boolean -) => T; +export const useStateFromStores = find(filters.byProps("useStateFromStores"), m => m.useStateFromStores); diff --git a/src/webpack/common/types/stores.d.ts b/src/webpack/common/types/stores.d.ts index 8e89a6e20..d6bf3aaf3 100644 --- a/src/webpack/common/types/stores.d.ts +++ b/src/webpack/common/types/stores.d.ts @@ -182,3 +182,10 @@ export class GuildStore extends FluxStore { getRoles(guildId: string): Record; getAllGuildRoles(): Record>; } + +export type useStateFromStores = ( + stores: t.FluxStore[], + mapper: () => T, + dependencies?: any, + isEqual?: (old: T, newer: T) => boolean +) => T;