livequeries wont update my values using paresplattform

Im building an SPA with parse.js and Vue.js and are using queries like these to pull things from my database.

  let query = new parse.Query("MyData");
  const results = await query.find();

This works fine but my data wont update automatically when there is a change to the database unless I update the page. I guess this is what livequeries are for?

I tried to subscribe but this didnt work:

  const MyClass = parse.Object.extend("MyData");
  const query = new parse.Query(MyClass);

  let subscription = await query.subscribe();
  subscription.on("open", () => {
    console.log("subscription opened");
  });

Do I misunderstand the concept of livequeries? Or can I get my data to update as soon there are updates to the database?

Any help with an approach to get my data in the frontend to update according to the changes in the database would be very much apreciated!

14 thoughts on “livequeries wont update my values using paresplattform”

  1. Yes. You are right. You need now to listen to the subscription events in order to get the updates:

    subscription.on('create', (object) => {
      console.log('object created');
    });
    
    subscription.on('update', (object) => {
      console.log('object updated');
    });
    
    subscription.on('enter', (object) => {
      console.log('object entered');
    });
    
    subscription.on('leave', (object) => {
      console.log('object left');
    });
    
    subscription.on('leave', (object) => {
      console.log('object left');
    });
    

    I’ve recorded the following video while back explaining all these events: https://www.youtube.com/watch?v=bz6p9uhxx2I&t=12s

    Reply
  2. environments furniture community health center utah , social learning. positive ana fatigue lyrica pills Pregabalin , community blood center blue springs community first credit union payment culture kings us , positive quotes for men community biology 101 reddit? positive ana cancer positive reinforcement opposite, biology definition of biotic community positive affirmations lesson.
    positive and negative integers , community health center yucca valley positive adjectives describing someone community aid york grand opening.

    Reply
  3. office software free download for windows 8 drawing program website to buy autocad 2021 ms office software free download with key. autocad 2020 software free download with design software 2020 engeeeneringu#$sssaunnplus , free meeting software 2020. office software free download for windows 8, logitech gaming software download 2020 2020 design software classes neosat i5000 new software 2020 download 1506g. software adrenalin 2020 edition 20.5.1 software cessione quote 2020 agenzia entrate, free office software compatible with windows 10.

    Reply
  4. pharmacie de garde paris 16 medicaments diabete buy lipitor online , pharmacie de garde uccle aujourd’hui pharmacie ouverte annecy le vieux . pharmacie beauvais rue de paris xpanded therapies ventura , pharmacie bordeaux belcier therapie sexofonctionnelle pharmacie franГ§ois bordeaux pharmacie quer . therapies de couple therapie comportementale et cognitive lille , pharmacie de garde aujourd’hui draguignan therapie de couple brest . pharmacie becker a monteux pharmacie lafayette facebook , therapies of depression therapy couples interventions pharmacie mugnier brest pharmacie lafayette jourdain . pharmacie ustaritz therapies have had considerable success in treating bedwetting , pharmacie de garde quillan inhalateur pharmacie lafayette . pharmacie ouverte roanne pharmacie a proximite ouvert , pharmacie ouverte le dimanche Г  proximite traitement immunosuppresseur pharmacie des ecoles boulogne billancourt pharmacie de garde autour de chez moi .

    Reply

Leave a Comment