Skip to content

Commit

Permalink
fix(StorageEvent): don't change event prototype
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielKucal committed Feb 17, 2018
1 parent 47b8f05 commit 8fea92f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 16 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "ngx-store",
"private": true,
"version": "1.4.0-RC1",
"version": "1.4.0-RC2",
"description": "Angular decorators to automagically keep variables in HTML5 LocalStorage, SessionStorage, cookies; injectable services for managing and listening to data changes and a bit more.",
"main": "./ngx-store.js",
"main for angular5": "./bundles/ngx-store.umd.js",
Expand Down
26 changes: 12 additions & 14 deletions src/utility/storage/storage-event.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,47 +18,45 @@ export class NgxStorageEvent implements StorageEvent {
public readonly url = window.location.href;
public isInternal = true;

constructor(public type: string, public key: string, public storageArea: Storage) {
setTimeout(() => Object.setPrototypeOf(this, new StorageEvent(type)));
}
constructor(public type: string, public key: string, public storageArea: Storage) {}

/**
* Methods below exist only to satisfy TypeScript compiler
*/

public get scoped() {
return undefined;
};
return StorageEvent.prototype.scoped;
}

public get initEvent() {
return undefined;
};
return StorageEvent.prototype.initEvent.bind(this);
}

public get preventDefault() {
return undefined;
return StorageEvent.prototype.preventDefault.bind(this);
}

public get stopImmediatePropagation() {
return undefined;
return StorageEvent.prototype.stopImmediatePropagation.bind(this);
}

public get stopPropagation() {
return undefined;
return StorageEvent.prototype.stopPropagation.bind(this);
}

public get deepPath() {
return undefined;
return StorageEvent.prototype.deepPath.bind(this);
}

public get AT_TARGET() {
return undefined;
return StorageEvent.prototype.AT_TARGET;
}

public get BUBBLING_PHASE() {
return undefined;
return StorageEvent.prototype.BUBBLING_PHASE;
}

public get CAPTURING_PHASE() {
return undefined;
return StorageEvent.prototype.BUBBLING_PHASE;
}
}

0 comments on commit 8fea92f

Please sign in to comment.