diff --git a/plop-templates/Component/Component.component.scss.hbs b/plop-templates/Component/Component.component.scss.hbs new file mode 100644 index 0000000..6fa764d --- /dev/null +++ b/plop-templates/Component/Component.component.scss.hbs @@ -0,0 +1,3 @@ +.c-{{pascalCase name}} { + +} diff --git a/plop-templates/Page/Page.module.scss.hbs b/plop-templates/Page/Page.module.scss.hbs new file mode 100644 index 0000000..6fa764d --- /dev/null +++ b/plop-templates/Page/Page.module.scss.hbs @@ -0,0 +1,3 @@ +.c-{{pascalCase name}} { + +} diff --git a/src/app/hooks.ts b/src/app/hooks.ts new file mode 100644 index 0000000..d72616b --- /dev/null +++ b/src/app/hooks.ts @@ -0,0 +1,6 @@ +import { TypedUseSelectorHook, useDispatch, useSelector } from "react-redux" +import type { RootState, AppDispatch } from "./store" + +// Use throughout your app instead of plain `useDispatch` and `useSelector` +export const useAppDispatch: () => AppDispatch = useDispatch +export const useAppSelector: TypedUseSelectorHook = useSelector diff --git a/src/app/store.ts b/src/app/store.ts new file mode 100644 index 0000000..c4249ae --- /dev/null +++ b/src/app/store.ts @@ -0,0 +1,17 @@ +import { configureStore, ThunkAction, Action } from "@reduxjs/toolkit" +import counterReducer from "../features/counter/counterSlice" + +export const store = configureStore({ + reducer: { + counter: counterReducer, + }, +}) + +export type AppDispatch = typeof store.dispatch +export type RootState = ReturnType +export type AppThunk = ThunkAction< + ReturnType, + RootState, + unknown, + Action +>