Functional-core-imperative-shell icon indicating copy to clipboard operation
Functional-core-imperative-shell copied to clipboard

Delaying or defering side-effects

Open olleharstedt opened this issue 3 years ago • 2 comments

Instead of writing to the database or file, create an event or closure to deal with it later.

https://martinfowler.com/eaaDev/EventSourcing.html

olleharstedt avatar Feb 12 '22 18:02 olleharstedt

Another post about similar concept: https://spin.atomicobject.com/2018/02/08/defer-side-effects/

olleharstedt avatar Feb 28 '22 20:02 olleharstedt

Cats effects for Scala: https://typelevel.org/cats-effect/docs/2.x/datatypes/io

olleharstedt avatar Feb 28 '22 20:02 olleharstedt