UNPKG

8.4 kBHTMLView Raw
1<!DOCTYPE html>
2<html lang="en">
3<head>
4 <meta charset="utf-8">
5 <title>JSDoc: Class: LokiLocalStorageAdapter</title>
6
7 <script src="scripts/prettify/prettify.js"> </script>
8 <script src="scripts/prettify/lang-css.js"> </script>
9 <!--[if lt IE 9]>
10 <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
11 <![endif]-->
12 <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
13 <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
14</head>
15
16<body>
17
18<div id="main">
19
20 <h1 class="page-title">Class: LokiLocalStorageAdapter</h1>
21
22
23
24
25
26
27<section>
28
29<header>
30
31 <h2>LokiLocalStorageAdapter</h2>
32
33
34</header>
35
36<article>
37 <div class="container-overview">
38
39
40
41
42
43 <h4 class="name" id="LokiLocalStorageAdapter"><span class="type-signature"></span>new LokiLocalStorageAdapter<span class="signature">()</span><span class="type-signature"></span></h4>
44
45
46
47
48
49<div class="description">
50 <p>A loki persistence adapter which persists to web browser's local storage object</p>
51</div>
52
53
54
55
56
57
58
59
60
61
62
63
64
65<dl class="details">
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92 <dt class="tag-source">Source:</dt>
93 <dd class="tag-source"><ul class="dummy"><li>
94 <a href="lokijs.js.html">lokijs.js</a>, <a href="lokijs.js.html#line2043">line 2043</a>
95 </li></ul></dd>
96
97
98
99
100
101
102
103</dl>
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121 </div>
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136 <h3 class="subsection-title">Methods</h3>
137
138
139
140
141
142
143 <h4 class="name" id="deleteDatabase"><span class="type-signature"></span>deleteDatabase<span class="signature">(dbname, callback)</span><span class="type-signature"></span></h4>
144
145
146
147
148
149<div class="description">
150 <p>deleteDatabase() - delete the database from localstorage, will throw an error if it
151can't be deleted</p>
152</div>
153
154
155
156
157
158
159
160
161
162 <h5>Parameters:</h5>
163
164
165<table class="params">
166 <thead>
167 <tr>
168
169 <th>Name</th>
170
171
172 <th>Type</th>
173
174
175
176
177
178 <th class="last">Description</th>
179 </tr>
180 </thead>
181
182 <tbody>
183
184
185 <tr>
186
187 <td class="name"><code>dbname</code></td>
188
189
190 <td class="type">
191
192
193<span class="param-type">string</span>
194
195
196
197 </td>
198
199
200
201
202
203 <td class="description last"><p>the filename of the database to delete</p></td>
204 </tr>
205
206
207
208 <tr>
209
210 <td class="name"><code>callback</code></td>
211
212
213 <td class="type">
214
215
216<span class="param-type">function</span>
217
218
219
220 </td>
221
222
223
224
225
226 <td class="description last"><p>the callback to handle the result</p></td>
227 </tr>
228
229
230 </tbody>
231</table>
232
233
234
235
236
237
238<dl class="details">
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265 <dt class="tag-source">Source:</dt>
266 <dd class="tag-source"><ul class="dummy"><li>
267 <a href="lokijs.js.html">lokijs.js</a>, <a href="lokijs.js.html#line2086">line 2086</a>
268 </li></ul></dd>
269
270
271
272
273
274
275
276</dl>
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298 <h4 class="name" id="loadDatabase"><span class="type-signature"></span>loadDatabase<span class="signature">(dbname, callback)</span><span class="type-signature"></span></h4>
299
300
301
302
303
304<div class="description">
305 <p>loadDatabase() - Load data from localstorage</p>
306</div>
307
308
309
310
311
312
313
314
315
316 <h5>Parameters:</h5>
317
318
319<table class="params">
320 <thead>
321 <tr>
322
323 <th>Name</th>
324
325
326 <th>Type</th>
327
328
329
330
331
332 <th class="last">Description</th>
333 </tr>
334 </thead>
335
336 <tbody>
337
338
339 <tr>
340
341 <td class="name"><code>dbname</code></td>
342
343
344 <td class="type">
345
346
347<span class="param-type">string</span>
348
349
350
351 </td>
352
353
354
355
356
357 <td class="description last"><p>the name of the database to load</p></td>
358 </tr>
359
360
361
362 <tr>
363
364 <td class="name"><code>callback</code></td>
365
366
367 <td class="type">
368
369
370<span class="param-type">function</span>
371
372
373
374 </td>
375
376
377
378
379
380 <td class="description last"><p>the callback to handle the result</p></td>
381 </tr>
382
383
384 </tbody>
385</table>
386
387
388
389
390
391
392<dl class="details">
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419 <dt class="tag-source">Source:</dt>
420 <dd class="tag-source"><ul class="dummy"><li>
421 <a href="lokijs.js.html">lokijs.js</a>, <a href="lokijs.js.html#line2055">line 2055</a>
422 </li></ul></dd>
423
424
425
426
427
428
429
430</dl>
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452 <h4 class="name" id="saveDatabase"><span class="type-signature"></span>saveDatabase<span class="signature">(dbname, callback)</span><span class="type-signature"></span></h4>
453
454
455
456
457
458<div class="description">
459 <p>saveDatabase() - save data to localstorage, will throw an error if the file can't be saved
460might want to expand this to avoid dataloss on partial save</p>
461</div>
462
463
464
465
466
467
468
469
470
471 <h5>Parameters:</h5>
472
473
474<table class="params">
475 <thead>
476 <tr>
477
478 <th>Name</th>
479
480
481 <th>Type</th>
482
483
484
485
486
487 <th class="last">Description</th>
488 </tr>
489 </thead>
490
491 <tbody>
492
493
494 <tr>
495
496 <td class="name"><code>dbname</code></td>
497
498
499 <td class="type">
500
501
502<span class="param-type">string</span>
503
504
505
506 </td>
507
508
509
510
511
512 <td class="description last"><p>the filename of the database to load</p></td>
513 </tr>
514
515
516
517 <tr>
518
519 <td class="name"><code>callback</code></td>
520
521
522 <td class="type">
523
524
525<span class="param-type">function</span>
526
527
528
529 </td>
530
531
532
533
534
535 <td class="description last"><p>the callback to handle the result</p></td>
536 </tr>
537
538
539 </tbody>
540</table>
541
542
543
544
545
546
547<dl class="details">
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574 <dt class="tag-source">Source:</dt>
575 <dd class="tag-source"><ul class="dummy"><li>
576 <a href="lokijs.js.html">lokijs.js</a>, <a href="lokijs.js.html#line2070">line 2070</a>
577 </li></ul></dd>
578
579
580
581
582
583
584
585</dl>
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608</article>
609
610</section>
611
612
613
614
615</div>
616
617<nav>
618 <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Collection.html">Collection</a></li><li><a href="DynamicView.html">DynamicView</a></li><li><a href="Loki.html">Loki</a></li><li><a href="LokiEventEmitter.html">LokiEventEmitter</a></li><li><a href="LokiFsAdapter.html">LokiFsAdapter</a></li><li><a href="LokiFsStructuredAdapter.html">LokiFsStructuredAdapter</a></li><li><a href="LokiIndexedAdapter.html">LokiIndexedAdapter</a></li><li><a href="LokiLocalStorageAdapter.html">LokiLocalStorageAdapter</a></li><li><a href="LokiMemoryAdapter.html">LokiMemoryAdapter</a></li><li><a href="LokiPartitioningAdapter.html">LokiPartitioningAdapter</a></li><li><a href="Resultset.html">Resultset</a></li></ul><h3>Tutorials</h3><ul><li><a href="tutorial-Autoupdating Collections.html">Autoupdating Collections</a></li><li><a href="tutorial-Changes API.html">Changes API</a></li><li><a href="tutorial-Collection Transforms.html">Collection Transforms</a></li><li><a href="tutorial-Indexing and Query performance.html">Indexing and Query performance</a></li><li><a href="tutorial-Loki Angular.html">Loki Angular</a></li><li><a href="tutorial-Persistence Adapters.html">Persistence Adapters</a></li><li><a href="tutorial-Query Examples.html">Query Examples</a></li></ul>
619</nav>
620
621<br class="clear">
622
623<footer>
624 Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.0</a> on Sun Dec 18 2016 19:39:52 GMT-0500 (Eastern Standard Time)
625</footer>
626
627<script> prettyPrint(); </script>
628<script src="scripts/linenumber.js"> </script>
629</body>
630</html>
\No newline at end of file