Skip to content

Commit

Permalink
Update according to issue #317
Browse files Browse the repository at this point in the history
  • Loading branch information
dfahlander committed Sep 21, 2016
1 parent a30faf7 commit 6c3fe59
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion samples/typescript/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This is a sample on how to use Dexie.js with Typescript and babel. The following

* How to subclass Dexie and define tables in a type-safe manner.
* How to create an entity with Dexie.
* How to use async / await with Dexie.
* How to use async / await with Dexie **NOTE! Discouraged since Typescript 2.0. See [this issue](https://github.com/dfahlander/Dexie.js/issues/317)**
* How to create something similar to navigation properties on entities.

## Install
Expand Down
5 changes: 4 additions & 1 deletion samples/typescript/src/app.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@

// DISCLAIMBER: This sample won't work with Typescript 2.0. Async / await is not encouraged any longer when using
// indexedDB in any library due to the incompability between IndexedDB and native Promise in Firefox, Safari and
// Edge browsers. See https://github.com/dfahlander/Dexie.js/issues/315

import Dexie from 'dexie';
import Console from './console';
import {db,Contact} from './appdb';
Expand Down
6 changes: 5 additions & 1 deletion samples/typescript/src/appdb.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import Dexie from 'dexie';
// DISCLAIMBER: This sample won't work with Typescript 2.0. Async / await is not encouraged any longer when using
// indexedDB in any library due to the incompability between IndexedDB and native Promise in Firefox, Safari and
// Edge browsers. See https://github.com/dfahlander/Dexie.js/issues/315

import Dexie from 'dexie';

const Promise = Dexie.Promise; // KEEP! (or loose transaction safety in await calls!)
const all = Promise.all;
Expand Down

0 comments on commit 6c3fe59

Please sign in to comment.