jeffmitchel / meteor-local-persist

Persistent client (browser) collections for Meteor, using localStorage.
Other
33 stars 11 forks source link

no persistence #5

Closed pierremzz closed 7 years ago

pierremzz commented 7 years ago

Hello, When i test your example like this :


// create a local collection,
    var shoppingCart = new Meteor.Collection('shopping-cart', {connection: null});

    // create a local persistence observer
    var shoppingCartObserver = new LocalPersist(shoppingCart, 'myShoppingApp');

    shoppingCart.insert({ item: 'DMB-01'+Math.floor(Math.random() * 10), quantity: Math.floor(Math.random() * 10) });

    console.log(shoppingCart.find({}).fetch())

when i refresh the page and fetch the collection, only the newly inserted data is returned by the fetch so there are no persistents data.