Last active
April 9, 2017 19:14
-
-
Save amitpdev/4badf35a2a514ff8ebdd2c5de99e184e to your computer and use it in GitHub Desktop.
A simple Singleton for Cloudinary on ES6 JS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as cloudinary from 'cloudinary-core'; | |
class CloudinaryManager { | |
static get shared() { | |
if (this.instance == null || this.instance == undefined) { | |
this.instance = cloudinary.Cloudinary.new(); | |
this.instance.config('cloud_name', 'mycloudname'); | |
} | |
return this.instance; | |
} | |
} | |
let imageURL = CloudinaryManager.shared.url('myimageid') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment