Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mrozbarry/react-native-weather
Offline-first react native weather app. Uses metaweather.com's API
https://github.com/mrozbarry/react-native-weather
Last synced: 27 days ago
JSON representation
Offline-first react native weather app. Uses metaweather.com's API
- Host: GitHub
- URL: https://github.com/mrozbarry/react-native-weather
- Owner: mrozbarry
- License: mit
- Created: 2019-06-24T17:29:54.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-12-09T07:33:35.000Z (almost 2 years ago)
- Last Synced: 2024-05-21T12:44:23.881Z (6 months ago)
- Language: JavaScript
- Size: 3.02 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 20
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# React Native Weather App
Offline-first react native weather app. Uses metaweather.com's API
## Installing
```bash
yarn
yarn start
# in another tab/whatever
yarn run ios
# or
yarn run android
```## Tech
Uses RealmDB and redux-saga to manage offline first behaviour.
## Flow
1. [USER] Search for a city (note: metaweather's location list is rather limited, aim for capitols/large cities)
2. [REDUX-SAGA] Kick off fork to search
- Start a live RealmDB query for our city
- On changes:
- Map Realm objects to location POJOs
- Submit data to redux
- Make request to API
- On success:
- Write to realm database (which will trigger above flow)
3. [REDUX-SAGA] Manage collection of forks to get weather reports for each location object
- To maintain the collection of forks
- If there is already a fork for this location woeid, continue
- If there isn't a fork for this location woeid, create one
- If a previous fork is no longer used, cancel it
- Each fork
- Start a live RealmDB query on reports for the location woeid
- Map Realm objects to report POJOs
- submit data to redux
- Make request to API
- On success:
- Write to realm database (which will trigger above flow)## Notes
This app is a demo, and not intended to be a released app, but I might release it in the future.
I will be adding an appropriate license later## License
Licensed under [MIT](./LICENSE.md).