feat: remove defer function prototype hack

This commit is contained in:
thecodrr
2020-08-25 08:53:46 +05:00
parent 04e94b1d74
commit 72af3bf19c
3 changed files with 1 additions and 11 deletions

View File

@@ -1,6 +1,5 @@
import "react-app-polyfill/ie11";
import "react-app-polyfill/ie9";
import "./utils/defer";
import "./utils/dimensions";
import React from "react";
import ReactDOM from "react-dom";

View File

@@ -69,7 +69,7 @@ class NoteStore extends BaseStore {
favorite = async (note) => {
await db.notes.note(note).favorite();
this.refreshContext.defer();
setTimeout(() => this.refreshContext(), 0);
this._setValue(note.id, "favorite", !note.favorite);
};

View File

@@ -1,9 +0,0 @@
function defer() {
setTimeout(this, 0);
}
// eslint-disable-next-line no-extend-native
Object.defineProperty(Function.prototype, "defer", {
value: defer,
writable: false,
});