@@ -12,7 +12,7 @@ Features an API using ES6 promises.
1212 * [ CrossStorageHub.init(permissions)] ( #crossstoragehubinitpermissions )
1313 * [ new CrossStorageClient(url, \[ opts\] )] ( #new-crossstorageclienturl-opts )
1414 * [ CrossStorageClient.prototype.onConnect()] ( #crossstorageclientprototypeonconnect )
15- * [ CrossStorageClient.prototype.set(key, value, \[ ttl \] )] ( #crossstorageclientprototypesetkey-value-ttl )
15+ * [ CrossStorageClient.prototype.set(key, value)] ( #crossstorageclientprototypesetkey-value )
1616 * [ CrossStorageClient.prototype.get(key1, \[ key2\] , \[ ...\] )] ( #crossstorageclientprototypegetkey1-key2- )
1717 * [ CrossStorageClient.prototype.del(key1, \[ key2\] , \[ ...\] )] ( #crossstorageclientprototypedelkey1-key2- )
1818 * [ CrossStorageClient.prototype.getKeys()] ( #crossstorageclientprototypegetkeys )
@@ -68,8 +68,7 @@ invalid.example.com.malicious.com.
6868var storage = new CrossStorageClient (' https://store.example.com/hub.html' );
6969
7070storage .onConnect ().then (function () {
71- // Set a key with a TTL of 90 seconds
72- return storage .set (' newKey' , ' foobar' , 90000 );
71+ return storage .set (' newKey' , ' foobar' );
7372}).then (function () {
7473 return storage .get (' existingKey' , ' newKey' );
7574}).then (function (res ) {
@@ -167,18 +166,15 @@ storage.onConnect().then(function() {
167166});
168167```
169168
170- #### CrossStorageClient.prototype.set(key, value, [ ttl ] )
169+ #### CrossStorageClient.prototype.set(key, value)
171170
172- Sets a key to the specified value, optionally accepting a ttl to passively
173- expire the key after a number of milliseconds. Returns a promise that is
174- fulfilled on success, or rejected if any errors setting the key occurred,
175- or the request timed out.
171+ Sets a key to the specified value. Returns a promise that is fulfilled on
172+ success, or rejected if any errors setting the key occurred, or the request
173+ timed out.
176174
177175``` javascript
178176storage .onConnect ().then (function () {
179- return storage .set (' key' , {foo: ' bar' });
180- }).then (function () {
181- return storage .set (' expiringKey' , ' foobar' , 10000 );
177+ return storage .set (' key' , JSON .stringify ({foo: ' bar' }));
182178});
183179```
184180
@@ -295,8 +291,7 @@ If you need to maximize your storage space, consider using
295291[ lz-string] ( https://github.com/pieroxy/lz-string/ ) . For smaller strings, it's
296292not uncommon to see a 50% reduction in size when compressed, which will bring
297293you a lot closer to 5 million characters. At that point, you're only limited by
298- the average compression rate of your strings, as well as the minor overhead
299- produced by the serialization format used by the library: JSON.
294+ the average compression rate of your strings.
300295
301296## Building
302297
@@ -311,7 +306,7 @@ the Travis CI build uses Sauce Labs for multi-browser testing as well.
311306
312307## Copyright and license
313308
314- Copyright 2014 Zendesk
309+ Copyright 2016 Zendesk
315310
316311Licensed under the Apache License, Version 2.0 (the "License"); you may not use
317312this file except in compliance with the License.
0 commit comments