Skip to content

Commit 61816da

Browse files
committed
Minor Readme changes
1 parent dda588c commit 61816da

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

README.md

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,16 @@ import { ClientStorage } from 'meteor/ostrio:cstorage';
3333
Usage:
3434
========
3535
#### Get
36-
- `ClientStorage.get(key)` - Read a record. If the key doesn't exist a null value will be returned.
36+
- `ClientStorage.get('key')` - Read a record. If the key doesn't exist a null value will be returned.
3737

3838
#### Set
3939
- `ClientStorage.set('key', value)` - Create/overwrite a value in storage
4040

4141
#### Remove
42-
- `ClientStorage.remove(key)` - Remove a record
42+
- `ClientStorage.remove('key')` - Remove a record
4343

4444
#### Has
45-
- `ClientStorage.has(key)` - Check whether a record exists, returns boolean value
45+
- `ClientStorage.has('key')` - Check whether a record exists, returns boolean value
4646

4747
#### Keys
4848
- `ClientStorage.keys()` - Returns an array of all storage keys
@@ -53,16 +53,24 @@ Usage:
5353
#### Use `cookies` only
5454
To use `cookies` as a driver for `ClientStorage` create new instance of `clientStorage` (*camel-case, first letter __lower-case__*)
5555
```js
56+
var clientStorage = require('ClientStorage').clientStorage;
5657
var csCookies = new clientStorage('cookies');
5758
```
5859

60+
or in ES6 (Meteor):
61+
```jsx
62+
import { clientStorage } from 'meteor/ostrio:cstorage';
63+
let csLocalStorage = new clientStorage('cookies');
64+
```
65+
5966
#### Use `localStorage` only
6067
To use `localStorage` as a driver for `ClientStorage` create new instance of `clientStorage` (*camel-case, first letter __lower-case__*):
6168
```js
6269
var clientStorage = require('ClientStorage').clientStorage;
6370
var csLocalStorage = new clientStorage('localStorage');
6471
```
65-
or in ES6:
72+
73+
or in ES6 (Meteor):
6674
```jsx
6775
import { clientStorage } from 'meteor/ostrio:cstorage';
6876
let csLocalStorage = new clientStorage('localStorage');
@@ -87,7 +95,7 @@ ClientStorage.has('city'); // false
8795
ClientStorage.keys(); // ['locale', 'country', 'gender']
8896

8997
ClientStorage.remove('locale'); // true
90-
ClientStorage.get('locale'); // null
98+
ClientStorage.get('locale'); // undefined
9199

92100
ClientStorage.keys(); // ['country', 'gender']
93101

0 commit comments

Comments
 (0)