From 431e4fc9d1657a50ebc34b8ac24f9bfaea06417f Mon Sep 17 00:00:00 2001 From: Soopyboo32 <49228220+Soopyboo32@users.noreply.github.com> Date: Sat, 17 Sep 2022 19:39:05 +0800 Subject: Initial move to babel + change fetch to use async/await --- .../settings/settingThings/FakeRequireToggle.js | 27 ++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 src/features/settings/settingThings/FakeRequireToggle.js (limited to 'src/features/settings/settingThings/FakeRequireToggle.js') diff --git a/src/features/settings/settingThings/FakeRequireToggle.js b/src/features/settings/settingThings/FakeRequireToggle.js new file mode 100644 index 0000000..41932f3 --- /dev/null +++ b/src/features/settings/settingThings/FakeRequireToggle.js @@ -0,0 +1,27 @@ + +class FakeRequireToggle{ + constructor(val){ + this.val = val + + this.thisToggleEvents = [] + + this.toggleObject = { + addEvent: (event)=>{ + this.thisToggleEvents.push(event) + } + } + } + + set(newVal){ + if(this.val === newVal) return + this.val = newVal + + this.thisToggleEvents.forEach(e=>e._trigger(this, [this.val])) + } + + getValue(){ + return this.val + } +} + +export default FakeRequireToggle \ No newline at end of file -- cgit