Ensono / Amido.Ecommerce.UI.Federated

Federated Modules Production Grade boilerplate for Next
MIT License
2 stars 0 forks source link

Redux Thunk #106

Open greg-toth opened 2 years ago

greg-toth commented 2 years ago

we need a solution to implement redux thunk and come up with a solution to deal with side effects and how to load data from databases.

theseanco commented 1 year ago

i'd suggest redux-toolkit to standardise our approach https://redux-toolkit.js.org/ - which includes a number of useful generators and wrappers for common redux tasks, as well as good typing support. Thunks are included OOTB.

velvetkevorkian commented 1 year ago

We are already using it https://github.com/amido/Amido.Ecommerce.UI.Federated/blob/main/apps/MFE/Header/src/ducks/headerCounter/index.ts#L1

theseanco commented 1 year ago

How did I miss that! Well using createAsyncThunk is common sense then. In that case can this ticket be closed, or does the solution need to be fleshed out further/an ADR written?

velvetkevorkian commented 1 year ago

My inclination would be that this is an MFE implementation detail and we can probably close this, unless there's something specific to async actions that breaks with federation? Maybe just needs a PoC implementation?

theseanco commented 1 year ago

Maybe just needs a PoC implementation?

Yeah might be wise, should be relatively easy, and redux-toolkit has very good documentation in my experience which is a huge plus. Could prepare one in a branch?