coopcycle / coopcycle-app

CoopCycle native app
MIT License
151 stars 33 forks source link

Streamlining Redux Boilerplate with createAsyncThunk #1781

Open r0xsh opened 4 months ago

r0xsh commented 4 months ago

we can get rid from some of this boilerplate by using createAsyncThunk from redux toolkit, it will create all these actions internally, see an example here: https://github.com/coopcycle/coopcycle-app/blob/21ba9b6a271e8cde8134dc1b2ca36b07aec45b9a/src/redux/Restaurant/actions.js#L427-L436

_Originally posted by @vladimir-8 in https://github.com/coopcycle/coopcycle-app/pull/1767#discussion_r1576631152_