Philipp Rost
  • Home
  • About
Subscribe
Tagged

chaining commands

A collection of 1 post

Chaining commands/methods in Typescript
chaining commands

Chaining commands/methods in Typescript

Chaining methods is incredibly useful when simplifying complex object creation. Let's say we have a class/object that accepts quite a large number of constructor arguments. As you can see in the example below, we have two optional arguments called strength and health. We can create setter methods for those

  • Philipp Rost
Philipp Rost May 18, 2021 • 1 min read
Philipp Rost © 2022
  • Data & privacy
  • Contact
  • Contribute →
Powered by Ghost