A simple example of MVVM in web, with tests!
This app uses the Open Weather API as a network call example.
You can create an API key with them for free! Set your key in an .env
file as REACT_APP_OPEN_WEATHER_API_KEY=yourKeyHere
.
Run yarn install
to get all of your dependencies.
Run yarn dev
to start the app and view it at http://localhost:3000/
.
Run yarn test
to run all tests and view coverage.
- Create an App Provider with an
AppViewModel
(actually call it main screen or something) - Lay out the App CurrentLocationWeatherView and make it look nice
- Remove the individual view providers
- Switch to decorators
- Maybe add a second page