From 72e535f5256dd32f6ff6be73a838caf5a586d0f0 Mon Sep 17 00:00:00 2001 From: Demonstrandum Date: Sun, 7 Oct 2018 11:24:58 +0100 Subject: [PATCH] Added functionality for namespaces --- lib/BasicCanvas.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/BasicCanvas.js b/lib/BasicCanvas.js index 7270268..54d473e 100755 --- a/lib/BasicCanvas.js +++ b/lib/BasicCanvas.js @@ -1,5 +1,8 @@ export const clone = obj => Object.assign(Object.create(Object.getPrototypeOf(obj)), console); +const use = (namespace, global=window) => Object.assign(global, namespace); +window.use = use; + Math.TAU = 2 * Math.PI; Math.HALF_PI = Math.PI * 0.5; Number.prototype.roundTo = function (dp) {