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.tscontains the domain model data structuresweather/show-weather-near-me.tscontains 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.tsis a redux middleware which interprets the domain actions and transforms them into side effectsindex.tscreates the redux store and initiates the showWeatherNearMeindex.htmlcontains the view templateweather/show-temperature-near-me-impure.tsis an impure version of the domain function above
- Install dependencies with
npm install - Run
npm startand 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.