@@ -5,7 +5,7 @@ import { BasePlugin } from '../base-plugins';
55 * @export
66 * @class UserDataPlugin
77 * @extends {BasePlugin }
8- * @property {SavedDataHandler } SavedDataHandler The handler to work with the savedData class
8+ * @property {SavedDataHandler } SavedDataHandler The handler to work with the savedData class
99 */
1010export class UserDataPlugin extends BasePlugin {
1111 /**
@@ -34,7 +34,7 @@ export class UserDataPlugin extends BasePlugin {
3434 }
3535
3636 /**
37- *
37+ *
3838 * @memberof UserDataPlugin
3939 */
4040 init ( ) {
@@ -54,27 +54,27 @@ export class UserDataPlugin extends BasePlugin {
5454 }
5555
5656 /**
57- * Handler for the userDataRemove event
57+ * Handler for the userDataRemove event
5858 * @method onUserDataRemove
5959 * @private
60- * @param {string } name The name of the record to be removed
60+ * @param {string } data The name of the record to be removed
6161 * @param {string } type The type of listener for bellhop to send to
6262 */
63- onUserDataRemove ( { name , type } ) {
64- SavedDataHandler . remove ( name , ( ) => {
63+ onUserDataRemove ( { data , type } ) {
64+ SavedDataHandler . remove ( data , ( ) => {
6565 this . client . send ( type ) ;
6666 } ) ;
6767 }
6868
6969 /**
7070 * Handler for the userDataRead event
7171 * @method onUserDataRead
72- * @private
73- * @param {string } name The name of the record to be removed
72+ * @private
73+ * @param {string } data The name of the record to be removed
7474 * @param {string } type The type of listener for bellhop to send to
7575 */
76- onUserDataRead ( { name , type } ) {
77- SavedDataHandler . read ( name , value => this . client . send ( type , value ) ) ;
76+ onUserDataRead ( { data , type } ) {
77+ SavedDataHandler . read ( data , value => this . client . send ( type , value ) ) ;
7878 }
7979
8080 /**
@@ -91,7 +91,7 @@ export class UserDataPlugin extends BasePlugin {
9191 }
9292
9393 // ----------------------------------------------------------------
94- // IndexedDB Manipulation
94+ // IndexedDB Manipulation
9595 // ----------------------------------------------------------------
9696
9797 /**
@@ -100,12 +100,12 @@ export class UserDataPlugin extends BasePlugin {
100100 * @param {string } dbName The name of your IndexedDB database
101101 * @param {string } [dbVersion] The version number of the database
102102 * @param {JSON } [additions] Any additions to the structure of the database
103- * @param {array } [additions.stores] Any stores to be added into the database syntax:
103+ * @param {array } [additions.stores] Any stores to be added into the database syntax:
104104 * @param {string } [additions.stores.storeName] The name of the store
105- * @param {object } [additions.stores.options] Optionally, the option parameter for the createStore method
106- * @param {array } [additions.indexes] Any Indexes to be added to the database syntax:
105+ * @param {object } [additions.stores.options] Optionally, the option parameter for the createStore method
106+ * @param {array } [additions.indexes] Any Indexes to be added to the database syntax:
107107 * @param {string } [additions.indexes.storeName] The name of the store
108- * @param {object } [additions.indexes.options] Optionally, the option parameter for the createIndex method
108+ * @param {object } [additions.indexes.options] Optionally, the option parameter for the createIndex method
109109 * @param {string } type The type of listener for bellhop to send to
110110 */
111111 onIDBOpen ( { type, data : { dbName, dbVersion = null , additions = { } , deletions = { } } } ) {
@@ -119,12 +119,12 @@ export class UserDataPlugin extends BasePlugin {
119119 * @param {string } type The type of listener for bellhop to send to
120120 * @param {string } storeName The name of the store from which the record will be updated
121121 * @param {* } value The value for the record with the given key to be updated
122- * @param {string } key the key of the record to be updated
122+ * @param {string } key the key of the record to be updated
123123 */
124124 onIDBAdd ( { type, data : { storeName, value, key} } ) {
125125 this . savedDataHandler . IDBAdd ( storeName , value , key , value => this . client . send ( type , value ) ) ;
126126 }
127-
127+
128128 /**
129129 * Update a record from a given store
130130 * @param {string } type The type of listener for bellhop to send to
@@ -140,7 +140,7 @@ export class UserDataPlugin extends BasePlugin {
140140 * Remove a record from a store
141141 * @param {string } type The type of listener for bellhop to send to
142142 * @param {string } storeName The name of the store from which the record will be removed
143- * @param {* } key the key of the record to be removed
143+ * @param {* } key the key of the record to be removed
144144 */
145145 onIDBRemove ( { type, data : { storeName, key} } ) {
146146 this . savedDataHandler . IDBRemove ( storeName , key , value => this . client . send ( type , value ) ) ;
@@ -149,13 +149,13 @@ export class UserDataPlugin extends BasePlugin {
149149 /**
150150 * Return a record from a given store with a given key
151151 * @param {string } storeName The name of the store to read from
152- * @param {string } key The key for the record in the given store
152+ * @param {string } key The key for the record in the given store
153153 * @param {string } type The type of listener for bellhop to send to
154154 */
155155 onIDBRead ( { type, data : { storeName, key} } ) {
156156 this . savedDataHandler . IDBRead ( storeName , key , value => this . client . send ( type , value ) ) ;
157157 }
158-
158+
159159 /**
160160 * Get all records from a store
161161 * @param {string } storeName The store to get all records from
@@ -165,7 +165,7 @@ export class UserDataPlugin extends BasePlugin {
165165 onIDBReadAll ( { type, data : { storeName, count} } ) {
166166 this . savedDataHandler . IDBReadAll ( storeName , count , value => this . client . send ( type , value ) ) ;
167167 }
168-
168+
169169 /**
170170 * Get the version of a given database
171171 * @param {string } dbName The name of the database to return the version of
@@ -176,7 +176,7 @@ export class UserDataPlugin extends BasePlugin {
176176 const sdh = new SavedDataHandler ( ) ;
177177 sdh . IDBGetVersion ( dbName , value => this . client . send ( type , value ) ) ;
178178 }
179-
179+
180180 /**
181181 * Close the connection with the database
182182 * @param {string } type The type of listener for bellhop to send to
0 commit comments