Posúva požiadavku po reťazi spracovateľov, kým ju niekto nevyrieši.
class Spracovatel { constructor() { this.dalsi = null; } posli(ziadost) { if (this.zvladne(ziadost)) { this.vybav(ziadost); return; } if (this.dalsi !== null) { this.dalsi.posli(ziadost); } }} class Veduci extends Spracovatel { zvladne(ziadost) { return ziadost.suma <= 1000; }} class Riaditel extends Spracovatel { zvladne(ziadost) { return ziadost.suma <= 10000; }} class Predstavenstvo extends Spracovatel { zvladne(ziadost) { return true; }} const veduci = new Veduci();veduci.dalsi = new Riaditel();veduci.dalsi.dalsi = new Predstavenstvo(); veduci.posli({ suma: 500 });veduci.posli({ suma: 8000 });veduci.posli({ suma: 200000 });