Skip to content
ignitae
Academy
JavaScript Design Patterns
Strategy, Observer, Factory and Decorator, rebuilt the idiomatic JS way.
Syllabus
Strategy
Strategy: swap the algorithm, keep the caller
Strategy pricing (exercise)
Observer
Observer: let listeners subscribe instead of being called by name
Observer event bus (exercise)
Factory
Factory: centralize construction behind a lookup
Factory shapes (exercise)
Decorator
Decorator: wrap a function, don't edit it
Decorator logging and retry (exercise)