Permanent Data Storage
Permanent Store
The Permanent Store, which is a large-scale object store built into the browser, facilitates persistent data storage using key-value pairs. It allows you to create web applications to function both online and offline.
createOrChangeStore
You can use createOrChangeStore() method:
For the isolation of the Permanent Store of two separate applications running in the same domain from each other (using SDK and coexistence).
For scenarios involving the use of multiple Permanent Store within the same domain.
quick.permanentStore.createOrChangeStore(storeName: string) : void
quick.permanentStore.createOrChangeStore("myStore");
If you are integrating with an application by using webSDK, you need to create the store name by using createOrChangeStore() method for your application.
We recommend using createOrChangeStore() method in the PreRender event of the PageComponent on your application's initial page.
deleteStore
deleteStore() method deletes the Permanent Store.
quick.permanentStore.deleteStore(storeName: string) : void
quick.permanentStore.deleteStore("myStore");
currentStoreName
currentStoreName property gets the Permanent Store name which provided by createOrChangeStore() method and currently being used.
quick.permanentStore.currentStoreName : string
quick.permanentStore.currentStoreName;
defaultStoreName
defaultStoreName property gets default Permanent Store name. If you don't provide the Permanent Store name that your application uses, default using store name will be PermanentStore.
quick.permanentStore.defaultStoreName : string
quick.permanentStore.defaultStoreName;
set object
set() method sets a key-value pair object to the Permanent Store.
quick.permanentStore.set(object: {key: string, value: any}) : void
quick.permanentStore.set({
key: "campany1",
value: {
campanyName: "Hayat Sigorta",
employeeList: [{ name: "ahmet" }, { name: "mehmet" }]
}
});
get object
get() method gets a key-value pair object from the Permanent Store.
quick.permanentStore.get(key: string) : Promise<{key: string, value: any}>
quick.permanentStore.get("campany1").then(response => {
quick.EM.trace(response);
});
OR
let response = await quick.permanentStore.get("campany1");
quick.EM.trace(response);
getAll objects
getAll() method gets all key-value pair objects from the permanent store.
quick.permanentStore.getAll() : Promise<{key: string, value: any}[]>
quick.permanentStore.getAll().then(response => {
quick.EM.trace(response);
});
OR
let response = await quick.permanentStore.getAll();
quick.EM.trace(response);
delete object
delete() method deletes a key-value pair object associated with the 'key' in the permanent store .
quick.permanentStore.delete(key: string) : void
quick.permanentStore.delete("campany1");
Determing Network Status
network.isConnected property determines the online/offline status of the network.
quick.Quick.network.isConnected : boolean
Listening For Changes In Network Status
When the onNetworkStatusChange event is added to the pipeline to listen for changes in network status, you can obtain the online/offline status of the Network.