Comments (3)
Hey,
Thanks for kind words 😄
Tbh I am not entirely sure what you mean.
"be able to listen for new notifications" - but you already are in charge of showing notifications, which means that you have control over them, which also means tou know when new notifications have to created.
"want to store notifications on a backend" - the plugin designed just to show notifications, if you need to store them on backend and query your backend for new notifications its entirely up to the implementation of your application.
from vue-notification.
Yes I do know when I create my notifications, I could just send a request to my backend every time I create a notification (that means one call to a function at each $notify() call, with a risk to forget it :D).
The idea would be to have one listener (a callback function) that will be called every time a notification is created.
But yes, I could implement that in my own app, I thought it would be cool to have that in Vue-notification but that's maybe overkill :)
from vue-notification.
Hey, sorry for a delay 😄
You can wrap your notify + post call into one function and extend vue prototype. Abstract example:
Vue.prototype.extendedNotify = function (payload) {
httpLibrary.post('/foo', payload)
.then(() => {
this.$notify(payload)
})
}
And ofc I would not mind PRs 😄 . The better solution though might be to $emit an event when notification is destroyed (before animation starts and/or after animation finished).
from vue-notification.
Related Issues (20)
- Custom template not displaying any notification when triggered HOT 4
- Use <notifications> element globally in a layout instead of individual vue files HOT 1
- Implement TypeScript HOT 2
- can't close a notification from a group HOT 2
- border-left doesn't painted in messages with type: success, warn and error messages HOT 1
- Vue 3 Support HOT 2
- closeOnClick: false doesn't work when using the API HOT 4
- Vue3 support HOT 2
- Enable displaying custom templates inside default <notifications /> tag HOT 1
- Setup Issue Vue.js 3 (Not a bug)
- Improve index.d.ts HOT 1
- Replacing only the data of the currently floating notification without generating a new notification HOT 1
- Can you clean notifications by "type"? HOT 1
- REQUEST TO PUBLISH LATEST RELEASE HOT 1
- Passing an id to Vue.notify for programatic closing causes TypeScript error HOT 1
- [Vue warn]: Duplicate keys detected: '1659456768077'. This may cause an update error. HOT 1
- vue 3 support HOT 3
- Custom Position HOT 2
- peer of vue 2 causes issue when compiling in vue 3 HOT 2
- NPM Update: Fork of Vue-Notification Available & Vue 3 Compatibility Guidance HOT 1
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 vue-notification.