Browse Source

Attempting to get jbox as a component

I would like it so you just grab the .js file for the component,
you'd like... but that seems more complex that I initially thought.
david 7 months ago
parent
commit
1e81325b0e
1 changed files with 7 additions and 6 deletions
  1. 7 6
      jbox.js

+ 7 - 6
jbox.js

@@ -16,10 +16,7 @@ Currently Supported Components:
 - rotate (Obtains angle, in degrees)
 */
 
-function jbox(tags=[]) {
-    let config = {
-        tags: tags,
-    };
+export function jbox(tags=[]) {
     return {
         id: "jbox",
         require: tags,
@@ -31,7 +28,7 @@ function jbox(tags=[]) {
                 jbox: "[[email protected]]",
                 comps: {},
             };
-            for (let tag in config.tags) {
+            for (let tag in tags) {
                 switch (tag) {
                     case "pos": {
                         j.comps["pos"] = {
@@ -61,4 +58,8 @@ function jbox(tags=[]) {
             return j;
         }
     }
-}
+}
+
+export default () => {
+    return jbox
+}