Skip to content
This repository has been archived by the owner on Aug 2, 2021. It is now read-only.

code.talks 2017 example code

License

Notifications You must be signed in to change notification settings

newcubator/purify-redux-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

purify-redux-example

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 structures
  • weather/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 user
  • weather/interpreter.ts is a redux middleware which interprets the domain actions and transforms them into side effects
  • index.ts creates the redux store and initiates the showWeatherNearMe
  • index.html contains the view template
  • weather/show-temperature-near-me-impure.ts is an impure version of the domain function above

Development Setup