Skip to content

Commit

Permalink
work in progress
Browse files Browse the repository at this point in the history
  • Loading branch information
ihasq committed Jan 14, 2024
1 parent 0c8affb commit 13d50cb
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 28 deletions.
Empty file added example/example.js
Empty file.
3 changes: 3 additions & 0 deletions example/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { Workio } from "../src/Workio.js"

await new Workio((name) => `Hello, ${name} from Workio!`, { type: Function })()
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"test": "test"
},
"scripts": {
"test": "npx standard && node ./test/standard.js"
"test": "npx standard && node ./test/standard.js",
"example": "node ./example/example.js"
},
"repository": {
"type": "git",
Expand All @@ -22,4 +23,4 @@
"url": "https://github.com/workio-js/workio/issues"
},
"homepage": "https://github.com/workio-js/workio#readme"
}
}
20 changes: 0 additions & 20 deletions src/Fn.js

This file was deleted.

19 changes: 19 additions & 0 deletions src/Workio.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { ScriptURL, UniversalWorker } from "./util/lib.js";
import { AM_I_NODE } from "./constants/lib.js";
import { WorkioWorker } from "./worker.js"

export class Workio {

Expand All @@ -14,6 +15,17 @@ export class Workio {
if(!workerFn instanceof Function) {
throw new TypeError("workerFn is not a type of function")
};
switch(config.type) {
case Worker:
case undefined:
return;

case Function:
return

case Object:
return
}
const compiledScriptURL = new ScriptURL(`
(async () => {
Expand Down Expand Up @@ -65,4 +77,11 @@ export class Workio {

}

/**
* @param { Object } functionList
*/
static public(functionList, options) {

}

};
Empty file added src/function.js
Empty file.
6 changes: 0 additions & 6 deletions src/lib.js

This file was deleted.

Empty file added src/object.js
Empty file.
5 changes: 5 additions & 0 deletions src/worker.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export class WorkioWorker {
constructor() {

}
}

0 comments on commit 13d50cb

Please sign in to comment.