Giter Site home page Giter Site logo

Comments (8)

technicalbirdVayuz avatar technicalbirdVayuz commented on June 19, 2024

Getting Error as, Minimongo.LocalCollection is not a constructor, Trying with

var User = new Minimongo.LocalCollection("data")

from blastjs.

jamesgibson14 avatar jamesgibson14 commented on June 19, 2024

Try new LocalCollection(null) or new LocalCollection('data') that is what I use.

from blastjs.

technicalbirdVayuz avatar technicalbirdVayuz commented on June 19, 2024

Hi @jamesgibson14 ,

Does this package provide reactivity? I have tried it but its only adds in local collection only, whenever I want to retrieve the data using the helper function, getting a blank array.

from blastjs.

jamesgibson14 avatar jamesgibson14 commented on June 19, 2024

Yes it does, in your helper just do something like:

getUser( userId ){
  return User.findOne({_id: userId})
}

from blastjs.

technicalbirdVayuz avatar technicalbirdVayuz commented on June 19, 2024

Attaching the code, please have a look

var User = new LocalCollection("data")

Template.listingLayout.onCreated(function(){
  User.insert({"title":"Hello"})
});

Template.listingLayout.helpers({
  data: function () {
    return User.find({}).fetch();
  },
});

document.addEventListener("dataReceived", function (data) {
  User.insert({ title: "New Data" });
 });

Dispatching event from the client side, but helper function returns only 1 document. Also, I am using it with webpack

from blastjs.

technicalbirdVayuz avatar technicalbirdVayuz commented on June 19, 2024

Changed to User.find({}) only, its working now, Thanks!

from blastjs.

harryadel avatar harryadel commented on June 19, 2024

Thank you @jamesgibson14 for your effort <3

from blastjs.

jamesgibson14 avatar jamesgibson14 commented on June 19, 2024

No problem, I am glad @technicalbirdVayuz figured it out.

from blastjs.

Related Issues (5)

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.