SyncChanges | Synchronize/Replicate database changes using SQL Server | Database library
kandi X-RAY | SyncChanges Summary
kandi X-RAY | SyncChanges Summary
Synchronize/Replicate database changes using SQL Server Change Tracking
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of SyncChanges
SyncChanges Key Features
SyncChanges Examples and Code Snippets
Community Discussions
Trending Discussions on SyncChanges
QUESTION
I'm trying to build a Chrome extension that consists mainly of a popup app. The problem is that whenever I click out of the popup (close it) the data I set disappears. Using the Storage Explorer extension as well as my own debugging console logs I can see for sure that it's getting set to chrome.storage.sync, but every time I reopen it all that data is gone.
Am I fundamentally misunderstanding how the API is meant to be used? I'm using React and building to a popup.html, I don't have a content.js or background.js. Do I instead need to be sending around messages for the data to persist?
Here is the relevant code in my React App.jsx. I have a sync function that I'm using to sync allData
(which is just an array of objects) and a data getter in componentWillMount:
ANSWER
Answered 2018-Sep-05 at 04:07The chrome.storage.sync.get
callback is passed an object with the data as key-value properties not your data directly. Thus your allData
variable is not your saved array, but an object that contains it. As such it has no length
property (unless you saved data named length
).
So on each opening you are resetting your data back to an empty array as if(allData.length)
will test as false because length
doesn't exist.
Check the appropriate property name, in your case .allData
, to see if you have already set the data
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install SyncChanges
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page