Skip to content
This repository has been archived by the owner on Sep 9, 2021. It is now read-only.

Commit

Permalink
fix: fix datastore factory (#65)
Browse files Browse the repository at this point in the history
* fix: fix datastore factory

The factory reference type can't extend the Datastore interface directly.

We want the class instance to implement the interface and not the class (Object) reference.

* fix: feedback

* fix: export

* fix: YAGNI
  • Loading branch information
hugomrdias committed Jan 22, 2021
1 parent 1137576 commit 586f883
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 6 deletions.
1 change: 0 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

/**
* @typedef {import('./types').Datastore} Datastore
* @typedef {import('./types').DatastoreFactory} DatastoreFactory
* @typedef {import('./types').Batch} Batch
* @typedef {import('./types').Options} Options
* @typedef {import('./types').Query} Query
Expand Down
5 changes: 0 additions & 5 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,6 @@ export interface Batch {
delete: (key: Key) => void
commit: (options?: Options) => Promise<void>
}

export interface DatastoreFactory extends Datastore {
new (): Datastore
}

export interface Datastore {
open: () => Promise<void>
close: () => Promise<void>
Expand Down

0 comments on commit 586f883

Please sign in to comment.