Skip to content

Commit

Permalink
update README with remarks and extra details
Browse files Browse the repository at this point in the history
  • Loading branch information
KtorZ committed Jul 7, 2017
1 parent 808de4f commit adf3422
Showing 1 changed file with 27 additions and 5 deletions.
32 changes: 27 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ This package offers complete bindings and type-safety upon the [IndexedDB API](h

## Overview

The `IDBCore` and `IDBFactory` are the two entry points required to create and connect to an
indexed database. From there, modules are divided such that each of them covers a specific IDB
interface.

They are designed to be used as qualified imports such that each method gets prefixed with a
menaingful namespace (e.g `IDBIndex.get`, `IDBObjectStore.openCursor` ...)

Here's a quick example of what it look likes.
```purescript
main :: Eff (idb :: IDB, exception :: EXCEPTION, console :: CONSOLE) Unit
main = launchAff' do
Expand All @@ -27,14 +35,28 @@ onUpgradeNeeded db _ = launchAff' do
pure unit
```

## Changelog
## Notes

- Release incoming
### Errors
Errors normally thrown by the IDB\* interfaces are wrapped in the `Aff` Monad as `Error`
where the `message` corresponds to the error's name (e.g. "InvalidStateError").
Pattern matching can therefore be done on any error message to handle specific errors thrown
by the API.

### Examples
The `test` folder contains a great amount of examples showing practical usage of the IDB\*
interfaces. Do not hesitate to have a peek should you wonder how to use one of the module. The
wrapper tries to keep as much as possible an API consistent with the original IndexedDB API.
Hence, it should be quite straightforward to translate any JavaScript example to a PureScript
one.

## Changelog

#### TODO
#### v0.9.0

- Add support for `index.getAll` method
- Complete the specifications with the [official tests list](https://github.com/w3c/web-platform-tests/blob/master/IndexedDB/README.md) provided by W3C
- [Indexed Database API 2.0](https://w3c.github.io/IndexedDB/) totally covered apart from
- `index.getAll` method (and the associated one for the IDBObjectStore)
- binary keys

## Documentation

Expand Down

0 comments on commit adf3422

Please sign in to comment.