reactjs - React native- Best way to create singleton pattern - Stack Overflow

PHOTO EMBED

Mon May 10 2021 07:18:30 GMT+0000 (UTC)

Saved by @govi #javascript #react.js

export default class Controller {
    static instance = Controller.instance || new Controller()

    helloWorld() {
        console.log("Hello World... \(^_^)/ !!")
    }
}
content_copyCOPY

https://stackoverflow.com/questions/44023879/react-native-best-way-to-create-singleton-pattern/45476473#45476473