Skip to content

Commit

Permalink
fixed return type for get
Browse files Browse the repository at this point in the history
  • Loading branch information
arvitaly committed Apr 7, 2018
1 parent bcecee1 commit f457421
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 24 deletions.
22 changes: 0 additions & 22 deletions .eslintrc

This file was deleted.

4 changes: 2 additions & 2 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ export class Onemitter<T> {
this.store.value = value;
this.listeners.map((cb) => cb(value));
}
public get() {
public get(): T {
if (!("value" in this.store)) {
throw new Error("Not have value");
}
return this.store.value;
return this.store.value as T;
}
public has() {
return "value" in this.store;
Expand Down

0 comments on commit f457421

Please sign in to comment.