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.
Hi guys,
I think the sdk could be improved as follows:
If we already have:
... 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