Closed ealemda2 closed 5 years ago
@ealemda2 - I like the consolidation and simplicity, great work!
Are you interested in completing the integration with members and recipes?
Also in regards to testing - has this been tested in both native (iOS/Android) and web?
Both members and recipes should be working as they're imported into store.js:
import reducers from '../reducers';
.
e.g. when you create a new user, the Redux dev tools shows a new user being added to the members: {}
in the state correctly.
It's been tested on iOS (iPhone X - 12.1) and Android (Pixel 2 - 9.0) simulators and web. I also tested it on my iPhone physically but don't have an access to an actual Android device at the moment.
Oh you mean converting the reducers etc. for members and recipes into their own models. I left them as they were to show that you can use a combination of existing redux stuff with new models. I can convert them if necessary though.
Hi @ealemda2 Got it. For clarity and to prescribe a single 'standard' way of redux implementation (which is helpful for boilerplates) - it'd be great to convert all existing 'models' to the rematch way.
@mcnamee I migrated the reducers and actions to Rematch models. Updated some docs to reflect it as well. Works fine on web, iOS and Android simulators. Let me know what you think, and if there's anything I missed.
Really good job @ealemda2
Few minor things I picked up before a merge:
redux-logger
you've implemented is fine - however it shouldn't be bundled for web production AND shouldn't run for React Native (it only buries the console in difficult to read text)src/containers/UpdateProfile.js
use the getUserData
function (if not let's remove
)?store/recipes
still needed? Previously, before recipes had loaded content from the API, it'd show the 'shadow content' seend in this file - kind of a usability nicety.@mcnamee Thanks for looking over it. I'll let you know when I've gotten around to making the minor fixes.
@mcnamee, I committed the fixes for the issues above!
As for using Redux DevTools with React Native Debugger, I had no problem running the RN Debugger on port 19001 and seeing the Redux state. It worked for me after clicking "Debug JS Remotely" from the Expo menu on the iOS or Android simulators while the RN Debugger is connected at 19001.
I remember having to delete the Expo app and reset the cache with expo r -c
when I had an issue with the Redux devtools before as well.
You're a legend @ealemda2 - great job!
Added Rematch to the project.
You can now use models that combine actions, action creators, state, and reducers in one place. I added a basic example under
src/models/example.js
.Existing Redux stuff still works since Rematch is build on top of Redux. Hope this is somewhat helpful and allows for an easier development process.