-
Notifications
You must be signed in to change notification settings - Fork 86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Best practices for an API #7
Comments
I would like if libs would provide multiple api styles (like f.e. lodash and lodash-fp). I think the way to go would be to create converter functions between different API styles, but blindly converting every function in a lib can be dangerous if you don't follow a strictly defined API. Btw. I just created such a converter bind-first and bind-last to make "traditional" libs work great with function bind-libs (i.e. trine). I think we will go the same way with 1-liners. There will probably be a 1-liners-curried/traditional/bindable. |
I was wondering about this yesterday too, but I thought of callbacks, promises, sync functions, futures, observables, events, ... so many possible different interfaces, so good luck in picking "the right" interface, or just expect wrappers of wrappers of your original API, or publish infinite versions 0/1/2/3/4/5 of the same lib. |
There seems to be disagreement in the community as to where data should land.
These different types of APIs often result in ugly code when mixed together.
Should a library provide three different APIs for different styles then? Go for the most popular (3)? Most flexible (1)? Most hip (2)?
I don’t know if such tips are in the scope of this repo. But I hope for some discussion – because I feel lost :)
The text was updated successfully, but these errors were encountered: