flickr-sdk icon indicating copy to clipboard operation
flickr-sdk copied to clipboard

Suggestion to improve Flickr.Upload

Open ianengelbrecht opened this issue 3 years ago • 0 comments

Hi guys,

I think the sdk could be improved as follows:

If we already have:

var flickr = new Flickr(Flickr.OAuth.createPlugin(
  process.env.FLICKR_CONSUMER_KEY,
  process.env.FLICKR_CONSUMER_SECRET,
  process.env.FLICKR_OAUTH_TOKEN,
  process.env.FLICKR_OAUTH_TOKEN_SECRET
));

... then why not just await flickr.upload(file, [args]) rather than having to call a constructor again?

It feels like this would be more intuitive. I've got a module where I create flickr and then I import it wherever I need it. But currently for upload, I have to create the auth function again, call a constructor, and await the resulting promise.

Great library though, I got up and running with the API very quickly.

Cheers,

Ian

ianengelbrecht avatar Sep 04 '22 13:09 ianengelbrecht