kbilsted / Functional-core-imperative-shell

Functional core imperative shell
Apache License 2.0
96 stars 5 forks source link

Delaying or defering side-effects #5

Open olleharstedt opened 2 years ago

olleharstedt commented 2 years ago

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 commented 2 years ago

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

olleharstedt commented 2 years ago

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