Custom API
Custom API is useful when one would like to abstract from a specific protocol and be able to replace transports while maintaining the same API.
For example, let's assume we want to use superagent API for our pipeline.
superagent.js
module {pipe;};{thispipe = pipe;thisoptions =method: 'GET';}{thisoptions = options;return this;}{thisoptionsmethod = 'POST';thisoptionsbody = body;return this;}{thisoptionspath = path;return this;}{// here we should initiate an actual flowthispipe;}
superagent-use.js
EDIT// Now let's use itconst pipe =;const agent = pipe;agent;
Contributors
Helpful? You can thank these awesome people! You can also edit this doc if you see any issues or want to improve it.