Sample Angular Application using Stream I/O patterns. This is a good pattern to adopt, but not subscribe.
- HTML > JS
- Use a component library!
- Containers are components that compose components. They should be responsible for passing data between effects and components.
- Services should contain functions that take in an input observable called a Source and return output observables called a Sink.
- Most components should be readonly and presentational. Components should take in values.
- Separate infrastructure from domain. Domain services that request "side effects" are known as effects.
- Effects should be the only things interacting with infrastructure.
- Testing is painful. Less JS, less testing.
- Don't use
tap
orsubscribe
. Async provides performance improvements too! - Angular Upgrade should only affect Infrastructure components
- Presentational components mostly immune due to simplicity.
- Effects mostly immune due as they are purely functional, but interactions with infrastructure may require changes.
- Containers immune due to interaction with domain effects and domain models.
- Try to keep things as single responsible as possible. See
hideSpinner$
coupling. - Avoid passing around
Subjects
, convert them to observables withasObservables
.
Upon inspection, the arrows are pointing the wrong way. Gotta fix this!
- Can we avoid
Subject
s completely by interacting with theEventEmitters
directly and avoiding the callbacks?