Skip to content

Commit

Permalink
Merge pull request #413 from aparzi/issue-372
Browse files Browse the repository at this point in the history
Issue 372
  • Loading branch information
aparzi authored Nov 17, 2024
2 parents 3c2b926 + b5951f1 commit 7e1c325
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ Returns the open cursor event

```js
this.dbService.openCursor('people', IDBKeyRange.bound("A", "F")).subscribe((evt) => {
var cursor = (evt.target as IDBOpenDBRequest).result;
const cursor = (evt.target as IDBOpenDBRequest).result as unknown as IDBCursorWithValue;
if(cursor) {
console.log(cursor.value);
cursor.continue();
Expand All @@ -369,7 +369,7 @@ Open a cursor by index filter.

```js
this.dbService.openCursorByIndex('people', 'name', IDBKeyRange.only('john')).subscribe((evt) => {
var cursor = (evt.target as IDBOpenDBRequest).result;
const cursor = (evt.target as IDBOpenDBRequest).result as unknown as IDBCursorWithValue;
if(cursor) {
console.log(cursor.value);
cursor.continue();
Expand Down
4 changes: 2 additions & 2 deletions projects/ngx-indexed-db/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ Returns the open cursor event

```js
this.dbService.openCursor('people', IDBKeyRange.bound("A", "F")).subscribe((evt) => {
var cursor = (evt.target as IDBOpenDBRequest).result;
const cursor = (evt.target as IDBOpenDBRequest).result as unknown as IDBCursorWithValue;
if(cursor) {
console.log(cursor.value);
cursor.continue();
Expand All @@ -368,7 +368,7 @@ Open a cursor by index filter.

```js
this.dbService.openCursorByIndex('people', 'name', IDBKeyRange.only('john')).subscribe((evt) => {
var cursor = (evt.target as IDBOpenDBRequest).result;
const cursor = (evt.target as IDBOpenDBRequest).result as unknown as IDBCursorWithValue;
if(cursor) {
console.log(cursor.value);
cursor.continue();
Expand Down
1 change: 1 addition & 0 deletions projects/ngx-indexed-db/src/lib/ngx-indexed-db.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,7 @@ export class NgxIndexedDBService {
* Returns the open cursor event
* @param storeName The name of the store to have the entries deleted
* @param keyRange The key range which the cursor should be open on
* @param direction A string telling the cursor which direction to travel. The default is next
*/
openCursor(storeName: string, keyRange?: IDBKeyRange, direction: IDBCursorDirection = 'next'): Observable<Event> {
return new Observable((obs) => {
Expand Down

0 comments on commit 7e1c325

Please sign in to comment.