I did this largely because I didn't want to be opinionated about the type of options that were supplied, since they will depend entirely on the adapter being used. For example, the only options being passed right now are the host and clientId, but there could easily be options that don't use the clientId for OAuth, and I can even see where p2p implementations might not even use a dedicated host.
A much better way of accommodating these options w/o being opinionated would be to use spread syntax:
This is such a simple, tiny change, but it will still be a major, breaking change, so best to do this now, before it's too pervasive. It will make for a much cleaner API, so I don't have to continually nest options, which I'm realizing is quite a PITA:
When the main factory function,
farmOS
, is called to instantiate the model and client, it gets a config object that containsremote.options
:https://github.com/farmOS/farmOS.js/blob/c5506ef913dfaee3a61a8e50eb9874920d9c52fe/src/index.js#L8-L18
I did this largely because I didn't want to be opinionated about the type of
options
that were supplied, since they will depend entirely on theadapter
being used. For example, the only options being passed right now are thehost
andclientId
, but there could easily be options that don't use theclientId
for OAuth, and I can even see where p2p implementations might not even use a dedicatedhost
.A much better way of accommodating these
options
w/o being opinionated would be to use spread syntax:This is such a simple, tiny change, but it will still be a major, breaking change, so best to do this now, before it's too pervasive. It will make for a much cleaner API, so I don't have to continually nest
options
, which I'm realizing is quite a PITA: