From 73ba955e344c8ccedd43235495ef8b72b5a2b6fd Mon Sep 17 00:00:00 2001 From: Ricardo Cino Date: Wed, 22 Jun 2022 00:32:18 +0200 Subject: chore: Transform AppStore.js into Typescript (#329) * turn actions into typescript * correct tsconfig * added TypedStore --- src/stores/index.ts | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'src/stores/index.ts') diff --git a/src/stores/index.ts b/src/stores/index.ts index 6ad898d85..a5b1a7452 100644 --- a/src/stores/index.ts +++ b/src/stores/index.ts @@ -1,3 +1,7 @@ +import { Stores } from 'src/stores.types'; +import { RouterStore } from 'mobx-react-router'; +import { ApiInterface } from 'src/api'; +import { Actions } from 'src/actions/lib/actions'; import AppStore from './AppStore'; import UserStore from './UserStore'; import FeaturesStore from './FeaturesStore'; @@ -12,8 +16,12 @@ import { workspaceStore } from '../features/workspaces'; import { communityRecipesStore } from '../features/communityRecipes'; import { todosStore } from '../features/todos'; -export default (api, actions, router) => { - const stores = {}; +export default ( + api: ApiInterface, + actions: Actions, + router: RouterStore, +): Stores => { + const stores: Stores | any = {}; Object.assign(stores, { router, app: new AppStore(stores, api, actions), @@ -37,5 +45,6 @@ export default (api, actions, router) => { stores[name].initialize(); } } + return stores; }; -- cgit v1.2.3-70-g09d2