paint-brush
Fluent Interface With Callbacksby@msarica
451 reads
451 reads

Fluent Interface With Callbacks

by Mehmet4mJanuary 3rd, 2020
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

The API is a callback based API that is used to run functions in order. Each function will run in order and 1 second apart. However, wouldn't it be nicer if we could chain methods? How I accomplished it: simply return the object reference to chain other methods so that we can run all of them in a nested way. The result is a fluent API that makes programming so much easier and easy to use with no need for a call-based API. For example, the class has 3 methods and each expects a callback function.

Coin Mentioned

Mention Thumbnail
featured image - Fluent Interface With Callbacks
Mehmet HackerNoon profile picture
Mehmet

Mehmet

@msarica

msarica.com

About @msarica
LEARN MORE ABOUT @MSARICA'S
EXPERTISE AND PLACE ON THE INTERNET.
L O A D I N G
. . . comments & more!

About Author

Mehmet HackerNoon profile picture
Mehmet@msarica
msarica.com

TOPICS

THIS ARTICLE WAS FEATURED IN...

Permanent on Arweave
Read on Terminal Reader
Read this story in a terminal
 Terminal
Read this story w/o Javascript
Read this story w/o Javascript
 Lite