mirror of
https://github.com/Esri/offline-editor-js.git
synced 2025-12-15 15:20:05 +00:00
updates retrieveEditsQueue from private to public
This commit is contained in:
parent
523a439f8b
commit
e036dbe02c
@ -117,13 +117,13 @@ Within your application you can manually check online status and then update you
|
||||
```
|
||||
|
||||
####editStore.hasPendingEdits()
|
||||
You can check if there are any edits pending by using the EditStore library. If there are edits then you can iterate `editsStore._retrieveEditsQueue()` and convert the edits to a readable format via `offlineFeaturesManager.getReadableEdit(edit)`.
|
||||
You can check if there are any edits pending by using the EditStore library. If there are edits then you can iterate `editsStore.retrieveEditsQueue()` and convert the edits to a readable format via `offlineFeaturesManager.getReadableEdit(edit)`.
|
||||
|
||||
```js
|
||||
var editStore = new O.esri.Edit.EditStore(Graphic);
|
||||
if( editStore.hasPendingEdits())
|
||||
{
|
||||
var edits = editStore._retrieveEditsQueue();
|
||||
var edits = editStore.retrieveEditsQueue();
|
||||
edits.forEach(function(edit)
|
||||
{
|
||||
var readableEdit = offlineFeaturesManager.getReadableEdit(edit);
|
||||
|
||||
@ -69,6 +69,7 @@ Methods | Returns | Description
|
||||
`isSupported()` | boolean | Determines if local storage is available. If it is not available then the storage cache will not work. It's a best practice to verify this before attempting to write to the local cache.
|
||||
`hasPendingEdits()` | boolean | Determines if there are any queued edits in the local cache.
|
||||
`resetEditsQueue()` | nothing | Empties the edits queue and replaces it with an empty string.
|
||||
`retrieveEditsQueue()` | Array | returns an array of all pending edits.
|
||||
`pendingEditsCount()` | int | The total number of edits that are queued in the local cache.
|
||||
`getEditsStoreSizeBytes()` | Number | Returns the total size of all pending edits in bytes.
|
||||
`getLocalStorageSizeBytes()` | Number | Returns the total size in bytes of all items for local storage cached using the current domain name.
|
||||
|
||||
@ -38,7 +38,7 @@ O.esri.Edit.EditStore = function(Graphic){
|
||||
graphic: this._serialize(graphic)
|
||||
};
|
||||
|
||||
var edits = this._retrieveEditsQueue();
|
||||
var edits = this.retrieveEditsQueue();
|
||||
edits.push(edit);
|
||||
var success = this._storeEditsQueue(edits);
|
||||
return { success: success, error: success? undefined : {code: 1000, description:this.ERROR_LOCALSTORAGE_FULL} };
|
||||
@ -46,7 +46,7 @@ O.esri.Edit.EditStore = function(Graphic){
|
||||
|
||||
this.peekFirstEdit = function()
|
||||
{
|
||||
var edits = this._retrieveEditsQueue();
|
||||
var edits = this.retrieveEditsQueue();
|
||||
var firstEdit;
|
||||
|
||||
if( edits )
|
||||
@ -60,7 +60,7 @@ O.esri.Edit.EditStore = function(Graphic){
|
||||
|
||||
this.popFirstEdit = function()
|
||||
{
|
||||
var edits = this._retrieveEditsQueue();
|
||||
var edits = this.retrieveEditsQueue();
|
||||
var firstEdit;
|
||||
|
||||
if( edits )
|
||||
@ -97,6 +97,12 @@ O.esri.Edit.EditStore = function(Graphic){
|
||||
window.localStorage.setItem(EDITS_QUEUE_KEY, "");
|
||||
};
|
||||
|
||||
this.retrieveEditsQueue = function()
|
||||
{
|
||||
var storedValue = window.localStorage.getItem(EDITS_QUEUE_KEY) || "";
|
||||
return this._unpackArrayOfEdits(storedValue);
|
||||
};
|
||||
|
||||
this.getEditsStoreSizeBytes = function()
|
||||
{
|
||||
var editsQueueValue = window.localStorage.getItem(EDITS_QUEUE_KEY);
|
||||
@ -147,12 +153,6 @@ O.esri.Edit.EditStore = function(Graphic){
|
||||
return graphic;
|
||||
};
|
||||
|
||||
this._retrieveEditsQueue = function()
|
||||
{
|
||||
var storedValue = window.localStorage.getItem(EDITS_QUEUE_KEY) || "";
|
||||
return this._unpackArrayOfEdits(storedValue);
|
||||
};
|
||||
|
||||
this._storeEditsQueue = function(edits)
|
||||
{
|
||||
try
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user