Skip to content

Commit

Permalink
0.0.852
Browse files Browse the repository at this point in the history
  • Loading branch information
bahrus committed Nov 13, 2024
1 parent bb2bd5f commit 3a26718
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 25 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@
"default": "./Mount.js",
"types": "./Mount.ts"
},
"./yield.js": {
"default": "./yield.js",
"types": "./yield.ts"
"./weave.js": {
"default": "./weave.js",
"types": "./weave.ts"
},
"./Object$tring.js": "./Object$tring.js",
"./Object$entences.js": "./Object$entences.js",
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"positractions/*",
"funions/Localizer.ts",
"asmr/*",
"yield.ts"
"weave.ts"
],
"exclude":[
"node_modules/*"
Expand Down
22 changes: 11 additions & 11 deletions yield.js → weave.js
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
export const yields = new Map();
export async function y(schema) {
return new Yield(schema);
const values = new Map();
export async function weave(schema) {
return new Weave(schema);
}
export async function a(guid) {
if (yields.has(guid))
return yields.get(guid);
export async function when(guid) {
if (values.has(guid))
return values.get(guid);
const { waitForEvent } = await import('./lib/waitForEvent.js');
await waitForEvent(window, guid);
return yields.get(guid);
return values.get(guid);
}
export class Yield {
export class Weave {
schema;
constructor(schema) {
this.schema = schema;
}
#to;
async to(guid) {
if (yields.has(guid))
async into(guid) {
if (values.has(guid))
return;
this.#to = guid;
const objToPipe = await this.#yield();
yields.set(guid, objToPipe);
values.set(guid, objToPipe);
window.dispatchEvent(new Event(guid));
}
async #yield() {
Expand Down
20 changes: 10 additions & 10 deletions yield.ts → weave.ts
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
import { USLMapping } from './ts-refs/trans-render/XV/types.js';

export const yields: Map<string, any> = new Map();
const values: Map<string, any> = new Map();

export async function y(schema: USLMapping){
return new Yield(schema);
export async function weave(schema: USLMapping){
return new Weave(schema);
}

export async function a(guid: string){
if(yields.has(guid)) return yields.get(guid);
export async function when(guid: string){
if(values.has(guid)) return values.get(guid);
const {waitForEvent} = await import('./lib/waitForEvent.js');
await waitForEvent(window, guid);
return yields.get(guid);
return values.get(guid);
}

export class Yield {
export class Weave {
constructor(public schema: USLMapping){}
#to: string | undefined;
async to(guid: string){
if(yields.has(guid)) return;
async into(guid: string){
if(values.has(guid)) return;
this.#to = guid;

const objToPipe = await this.#yield();
yields.set(guid, objToPipe);
values.set(guid, objToPipe);
window.dispatchEvent(new Event(guid));
}

Expand Down

0 comments on commit 3a26718

Please sign in to comment.