Skip to content

Commit

Permalink
docs: Add 1.5 Safari 10.1 notes
Browse files Browse the repository at this point in the history
  • Loading branch information
tofumatt committed Feb 18, 2017
1 parent f524ed5 commit d469da1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Expand Up @@ -3,6 +3,9 @@
This file will include all API breakage, new features, and upgrade info in
localForage's lifetime.

### [1.5](https://github.com/mozilla/localForage/releases/tag/1.5.0)
* **Major storage engine change for Safari**: We now use IndexedDB as the storage engine for Saferi v10.1 (and above). This means sites using localForage for data storage with users using Safari `< 10.1` will experience "data loss". In fact no data is lost but the engine will change so localForage will seem empty. You can still force a connection to WebSQL using [localForage's config](https://localforage.github.io/localForage/#settings-api-setdriver) to either keep using your existing WebSQL database or migrate to IndexedDB.

### [1.4.2](https://github.com/mozilla/localForage/releases/tag/1.4.2)
* Fixes #562.

Expand Down
10 changes: 7 additions & 3 deletions README.md
Expand Up @@ -50,6 +50,10 @@ is usually online from 8am-8pm GMT (London Time).

[tofumatt]: http://tofumatt.com/

## Safari 10.1+

Since Safari 10.1 we default to IndexedDB; see the [CHANGELOG](https://github.com/localForage/localForage/blob/master/CHANGELOG.md) for more info.

# How to use localForage

## Callbacks vs Promises
Expand All @@ -58,7 +62,7 @@ Because localForage uses async storage, it has an async API.
It's otherwise exactly the same as the
[localStorage API](https://hacks.mozilla.org/2009/06/localstorage/).

localForage has a dual API that allows you to either use Node-style callbacks
localForage has a dual API that allows you to either use Node-style callbacks
or [Promises](https://www.promisejs.org/). If you are unsure which one is right for you, it's recommended to use Promises.

Here's an example of the Node-style callback form:
Expand All @@ -67,7 +71,7 @@ Here's an example of the Node-style callback form:
localforage.setItem('key', 'value', function (err) {
// if err is non-null, we got an error
localforage.getItem('key', function (err, value) {
// if err is non-null, we got an error. otherwise, value is the value
// if err is non-null, we got an error. otherwise, value is the value
});
});
```
Expand All @@ -84,7 +88,7 @@ localforage.setItem('key', 'value').then(function () {
});
```

For more examples, please visit [the API docs](https://localforage.github.io/localForage).
For more examples, please visit [the API docs](https://localforage.github.io/localForage).

## Storing Blobs, TypedArrays, and other JS objects

Expand Down

0 comments on commit d469da1

Please sign in to comment.