5 ms·
Chaining is fine when building up an object, but definitely not something that should be systematically used. That's making the interface more complicated for l
by laurent123456 5y ago
Chaining is fine when building up an object, but definitely not something that should be systematically used. That's making the interface more complicated for little gain.
- G3rn0ti 5y agoWhy? Whenever you return „void“ you return „this“. That does not make anything more complicated. It is a pattern that suits itself well in front end code. When it comes to async. code, however, it’s a different story since you return promises in this case that are also chainable.
- laurent123456 5y ago> When it comes to async. code, however, it’s a different story since you return promises in this case that are also chainable. So that's one issue. That's what I mean by the interface being more complicated - void is void, but if you return something there might be some edge cases, some of which are difficult to predict. Personally I think it's not worth the trouble.