Commit Graph

15 Commits

Author SHA1 Message Date
Matthew Dapena-Tretter
881cbbd17f Add delete() method to StateStore
This allows us to delete single items.
2017-04-04 13:45:14 -07:00
Antonio Scandurra
f5a19a6904 Move StateStore into the snapshot 2017-03-10 16:50:50 +01:00
Ian Olsen
66ae68828e Make stateStore.isConnected a method 2017-01-18 15:57:35 -08:00
Ian Olsen
64f53ee2db Check whether state store is connected when prompting to save files 2017-01-17 16:15:12 -08:00
Antonio Scandurra
880328bf6e Fix lint errors 2016-08-29 10:40:07 +02:00
Nathan Sobo
b5b3577d7c Fix null guard in StateStore 2016-08-11 14:31:08 -06:00
Antonio Scandurra
7176da7614 Use structured cloning 2016-03-04 15:17:10 +01:00
Antonio Scandurra
a361cd7f40 🐎 Use JSON.stringify to serialize state 2016-02-22 11:56:45 +01:00
Antonio Scandurra
677568d9af Use window.requestIdleCallback in StateStore.prototype.save
This should alleviate some of the pressure of serializing changes on the main
thread. We're assuming that `deadline.timeRemaining()` is high enough to compute
the serialization because there's no simple path to serialize state across many
`requestIdleCallback`s (e.g. because state might change between two callbacks).
2016-02-22 11:34:13 +01:00
Katrina Uychaco
255b943d45 Add ability to clear IndexedDB state object store 2016-02-11 19:56:25 -08:00
Katrina Uychaco
7b808257a6 Add test to check for indexedDB connection 2016-02-10 11:04:30 -08:00
Max Brunsfeld
fa70560eba 👕 Use single quotes in JS string
Signed-off-by: Katrina Uychaco <kuychaco@github.com>
2016-02-09 14:34:32 -08:00
Max Brunsfeld
b0cf440f9c Handle database connection errors gracefully
When opening a second Atom instance (e.g. when running the integration specs)
indexedDB connections will fail. In this case, StateStore.prototype.save
and StateStore.prototype.load will become noops.

Signed-off-by: Katrina Uychaco <kuychaco@github.com>
2016-02-09 14:30:10 -08:00
Katrina Uychaco
85b32b861e Add storedAt date for serialized environment state 2016-02-08 10:36:05 -08:00
Katrina Uychaco
3b500daab4 Create StateStore class and specs for storing state in IndexedDB 2016-02-04 21:43:44 -08:00