Sitemap
Tanya Gray

Tanya Gray

Director of Engineering at Soul Machines

NgRx TLDR

1 min readApr 11, 2023

Sick of too many big words? This is NgRx, simplified.

TL;DR:

  • Actions are basically events. They go “pew pew” with a unique name, and some data attached, just like an event.
  • Reducers are like event handlers that react to Actions. Their only job is to update the app state and nothing else. App state is just a simple object, like a big blob of JSON, so a reducer takes in Actions (events) and merges the event data into the giant blob of JSON.
  • Effects are also like event handlers that react to Actions, but they’re allowed to do some logic. An Effect always takes an Action in, spits an Action out. In the middle they usually make an API call or run some other data processing function, and so they’ll be spitting out either a “success” Action or a “failure” Action.
  • Selectors are for getting data out of the app state. Once you create a selector, it’ll watch the app state and then emit the new value each time the underlying data changes.

👌 nice.

Get Tanya Gray’s stories in your inbox

Join Medium for free to get updates from this writer.

Further Reading:

--

--

Tanya Gray
Tanya Gray

Written by Tanya Gray

Director of Engineering at Soul Machines