cellplatform / platform-0.2.0

/sys (shared system modules)
Other
4 stars 2 forks source link

CRDT Dynamic Module Loading #177

Closed philcockfield closed 5 months ago

philcockfield commented 6 months ago

Changes:


image image

Strongly Typed Function Loader

written, then moved to "archive" as unneeded: commit:44120a8678105b495df5672ba9225a80b1d1affd

Strongly typed functional wrapper for a the ES2020 (ESM) standard import() expression allowing for dynamic importing (and bundler code-spitting) within ECMAScript/Typescript.

type R = number;
type P = { sum?: number[] };

const fn1 = Func.import<R, P>(async (e) => 💦 );
const fn2 = Func.import<R>(async (e) => 💦 );

const res = await fn1();
const res = await fn2({ sum: [1, 2, 3] }); // res equals 6

smor-sys crdt-cell-timeline

smor-sys crdt-cell-timeline