Multiple commits - I moved most of the files that can be shared between the Rails app and the react-native app. Goal was to share actions, reducers, sagas, action types, schemas, and selectors, plus the common API library implementation to talk to the REST API.
There are a couple little hacks in here to make the common directory live at the top level of the project tree, and as a proto module, notably React Native packager does not like this, nor does it like ln -s so I added a config file (rn-cli.config.js) for it to treat this as a part of the project. Once this is configured RN packager reads the package.json and treats the common dir like a node_modules package which can be imported using the name property in the package.json file.
I made changes to the utils api library to work in a node environment as well as in a browser environment. There are some other changes (see comments in the files) that allow me to fetch all the todos at app startup time.
This is a work in progress but hopefully this is going in the right direction here.
Multiple commits - I moved most of the files that can be shared between the Rails app and the react-native app. Goal was to share actions, reducers, sagas, action types, schemas, and selectors, plus the common API library implementation to talk to the REST API.
There are a couple little hacks in here to make the common directory live at the top level of the project tree, and as a proto module, notably React Native packager does not like this, nor does it like ln -s so I added a config file (rn-cli.config.js) for it to treat this as a part of the project. Once this is configured RN packager reads the package.json and treats the common dir like a node_modules package which can be imported using the name property in the package.json file.
I made changes to the utils api library to work in a node environment as well as in a browser environment. There are some other changes (see comments in the files) that allow me to fetch all the todos at app startup time.
This is a work in progress but hopefully this is going in the right direction here.
This change is