Comments (5)
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.
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.
You're right. I'll modify it to fit the description. Thank you for your insight 👍
from angular2-notifications.
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.
That sounds great, thanks for the quick fix!
from angular2-notifications.
Related Issues (20)
- Demo on StackBlitz has broken image (Jaspero logo)
- Keep notifications accessible after they are hidden
- Angular 11 version HOT 3
- NPM - Recent Release 12.0.0 HOT 5
- CHANGELOG outdated (no mention of version 3 and ulterior)
- README: Broken link to Creating Notifications anchor
- README: Creating Notifications section outdated
- incompatible peer dependency to @angular/... - requires "^9.0.0" HOT 3
- Error using version 12 in child HOT 1
- issue with lazy loaded module in angular 13 HOT 4
- Notifications closing improperly
- Migration angular 13 HOT 1
- Pause (progress) on hover not working as expected
- Migration angular 14 HOT 1
- No angular 11 release available HOT 1
- Please make a release HOT 3
- MatTooltip over angular2-notification
- Migration Angular 16 HOT 1
- Html notification HOT 1
- Support for Angular 17 HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from angular2-notifications.