mcnamee / react-native-starter-kit

:rocket: A React Native boilerplate app to get you up and running very, very quickly :rocket:
MIT License
3.35k stars 863 forks source link

Rematch integration #216

Closed ealemda2 closed 5 years ago

ealemda2 commented 5 years ago

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.

mcnamee commented 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?

ealemda2 commented 5 years ago

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.

ealemda2 commented 5 years ago

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.

mcnamee commented 5 years ago

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.

ealemda2 commented 5 years ago

@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.

mcnamee commented 5 years ago

Really good job @ealemda2

Few minor things I picked up before a merge:

ealemda2 commented 5 years ago

@mcnamee Thanks for looking over it. I'll let you know when I've gotten around to making the minor fixes.

ealemda2 commented 5 years ago

@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.

rn-debugger

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.

mcnamee commented 5 years ago

You're a legend @ealemda2 - great job!