Functional-core-imperative-shell
Functional-core-imperative-shell copied to clipboard
Delaying or defering side-effects
Instead of writing to the database or file, create an event or closure to deal with it later.
https://martinfowler.com/eaaDev/EventSourcing.html
Another post about similar concept: https://spin.atomicobject.com/2018/02/08/defer-side-effects/
Cats effects for Scala: https://typelevel.org/cats-effect/docs/2.x/datatypes/io