Loading ...
Sorry, an error occurred while loading the content.

Booting up TaffyDB from localStorage for persistence

Expand Messages
  • elfgoh
    I am using .store() with TaffyDB to persist data to localStorage. I would like to be able to boot TaffyDB up from localStorage, and continue using .store()
    Message 1 of 1 , Mar 19, 2013
    View Source
    • 0 Attachment
      I am using .store() with TaffyDB to persist data to localStorage.

      I would like to be able to 'boot' TaffyDB up from localStorage, and continue using .store() to persist to localStorage.

      However, I find that if I do:

      c = TAFFY(JSON.parse( localStorage.taffy_foo))

      where taffy_foo has a valid TaffyDB persistance, any updates made to c eg inserts are not subsequently updated to localStorage.

      I then proceeded to do c.store('foo') which causes the database rows to double, presumably because .store() appends instead of replaces. It seems that I would need to delete the existing localStorage entry in order to avoid this issue of data doubling.

      Can I confirm if my observations and conclusions are correct in implementation of a persistence TaffyDB? Thanks.



      Cheers,

      Luther
    Your message has been successfully submitted and would be delivered to recipients shortly.