Giter Club home page Giter Club logo

Comments (4)

MichalAlgor avatar MichalAlgor commented on June 1, 2024

The current solution let you do that. You don't have to use shared singleton, just do as you proposed. Use different instances of Typist in your controllers.

from typist.

colinta avatar colinta commented on June 1, 2024

Right, but encouraging the use of the singleton will lead to bugs. The "correct use" should be the one that is documented in the README. As it is now, the README doesn't mention this bug/limitation. Your package was included in "little bites of cocoa" and the author there also didn't point out that using the singleton is a bad idea, probably because it's not mentioned in the README.

from typist.

totocaster avatar totocaster commented on June 1, 2024

Hey Colin, what you described is true and I though that's was obvious, thus the comment in README about singleton vs new instance. Reason there is an option to use singleton at all is to give quick access to instance without having a dedicated class property (Typist().on(... would deallocate immediately.) Having said that, your argument is totally valid. I'll reword docs and mention this limitation when working with singleton. β€”Thank you!

from typist.

totocaster avatar totocaster commented on June 1, 2024

Updated README. This is not final decision though, I'll think more about singleton usage and it's benefits vs confusion factor.

from typist.

Related Issues (16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.