How do I create a function/object which supports chaining?
Let's assume I have three functions one()
, two()
, three()
, etc. I want these function to support chaining.
Example :
one().two().three();
or
three().two().one();
Something similar to calling many APIs in JavaScript:
fetch().then().then()