Using the business logic in our Amazhop website
To get started with this section, we must add the @amazhop/logic
package inside our dependencies
list:
"dependencies": { Â Â Â Â "@amazhop/logic": "0.1.0",
Once it's done, just run yarn install
to make sure that it's installed correctly.
And let's start with the first file on every Rematch implementation, initializing the store and wrapping our application with the Redux provider.
We could replace the whole store/index.ts
file with just these 13 lines:
import { lazyStore, Dispatch, RootState } from "@amazhop/logic"; import createPersistPlugin from "@rematch/persist"; import storage from "redux-persist/lib/storage"; export const store = lazyStore({ Â Â extraPlugins: [ Â Â Â Â createPersistPlugin({ Â Â Â Â Â Â key: "cart-storage", Â Â Â Â Â Â storage...