Giter VIP home page Giter VIP logo

Comments (5)

flauc avatar flauc commented on September 14, 2024

You're right, but now i can't decide what the behavior should be? Should it prevent 2 same notifications to show on the screen at the same time, or should i prevent creating a notification equal to the last notification created.

What do you think?

from angular2-notifications.

trognus avatar trognus commented on September 14, 2024

I would expect the latter to be far more useful. The preventDuplicates flag could be used to prevent most other cases of duplicate notifications being created, and I doubt there's a lot of cases where someone doesn't want duplicate notifications in a row to be created, but wants other duplicates to be allowed. Preventing a notification equal to the last created, though, allows an app to silence a continuous stream of duplicate notifications, which can be useful.

from angular2-notifications.

flauc avatar flauc commented on September 14, 2024

You're right. I'll modify it to fit the description. Thank you for your insight 👍

from angular2-notifications.

flauc avatar flauc commented on September 14, 2024

I've actually kept both implementations. In the new library version the preventLastDuplicates option now excepts one of the following values:

  • false
  • "all"
  • "visible"

So if it has the value "all" it prevents duplicates of the last notification created, but if it has the value visible it prevents duplicates of the last visible notification.

I'll add this to the readme later today but it's already published so you can test it out if you want to.

from angular2-notifications.

trognus avatar trognus commented on September 14, 2024

That sounds great, thanks for the quick fix!

from angular2-notifications.

Related Issues (20)

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.