algoliasearch-client-javascript icon indicating copy to clipboard operation
algoliasearch-client-javascript copied to clipboard

Named argument for js client.

Open fulmicoton opened this issue 13 years ago • 3 comments

This issue is not exactly an issue, but I thought it might be a good thing to raise the subject before the client gets very popular. Have you thought of using a dictionary as an argument for the creation of the Algolia object?

As a benefit,

  1. you could give the JSON representation of this dictionary in all the place where you present the user credentials. It will be a valid literal, ready for copy-paste for JS, NodeJS but also python !

  2. it will make it easier for you to grow the API options.

  3. it will help people, as their configuration will probably, be in one way or another, serialized or defined beforehands in their code.

fulmicoton avatar May 29 '13 21:05 fulmicoton

We have few parameters in the init, I am not sure about the advantages of a dictionary for such a small set. I see advantages when the set is >= 5. If we see an advantage later, we can still decide to add another init function with a dictionary :)

speedblue avatar Jun 05 '13 15:06 speedblue

I like named arguments too, reduce FUD on the API.

vvo avatar Nov 29 '14 18:11 vvo

see #40

vvo avatar Mar 09 '15 13:03 vvo