syntax highlighting
This commit is contained in:
parent
c617241c52
commit
9b930a09aa
|
@ -11,6 +11,7 @@ This is meant for the purpose of being able to run unit-tests and such for brows
|
|||
Usage
|
||||
----
|
||||
|
||||
```javascript
|
||||
var Storage = require('dom-storage')
|
||||
|
||||
// in-file, doesn't call `String(val)` on values (default)
|
||||
|
@ -28,6 +29,7 @@ Usage
|
|||
// use JSON to stringify / parse when using strict w3c compliance
|
||||
sessionStorage.setItem('myKey', JSON.stringify(myValue));
|
||||
myValue = JSON.parse(localStorage.getItem('myKey'));
|
||||
```
|
||||
|
||||
API
|
||||
---
|
||||
|
@ -42,6 +44,7 @@ API
|
|||
Tests
|
||||
---
|
||||
|
||||
```javascript
|
||||
0 === localStorage.length;
|
||||
null === localStorage.getItem('doesn't exist');
|
||||
undefined === localStorage['doesn't exist'];
|
||||
|
@ -58,6 +61,7 @@ Tests
|
|||
|
||||
localStorage.clear();
|
||||
0 === localStorage.length;
|
||||
```
|
||||
|
||||
Notes
|
||||
---
|
||||
|
|
Loading…
Reference in New Issue