This is a small redux sample app which demonstrates how domain logic can be written in a pure, self-contained form which is completely decoupled from any framework-dependent code.
weather/domain.ts
contains the domain model data structuresweather/show-weather-near-me.ts
contains a use case / domain function which locates the users geo position, gets the current temperature for that position and shows it to the userweather/interpreter.ts
is a redux middleware which interprets the domain actions and transforms them into side effectsindex.ts
creates the redux store and initiates the showWeatherNearMeindex.html
contains the view templateweather/show-temperature-near-me-impure.ts
is an impure version of the domain function above
- Install dependencies with
npm install
- Run
npm start
and open http://localhost:8080 - This app uses the Open Weather Map API. You need to allow cross-origin requests in the browser to make this sample work.