GithubHelp home page GithubHelp logo

Comments (3)

euvl avatar euvl commented on September 12, 2024

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.

Yaty avatar Yaty commented on September 12, 2024

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.

euvl avatar euvl commented on September 12, 2024

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)

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.