Skip to content

Commit

Permalink
Create theory.js
Browse files Browse the repository at this point in the history
  • Loading branch information
lxsmnsyc committed Nov 18, 2023
1 parent 66f5440 commit 7b03f61
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions packages/seroval/theory.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { Serializer } from "./dist/esm/development/index.mjs";

const sleep = (value, ms) => (
new Promise((res) => setTimeout(res, ms, value))
);

async function * example() {
yield sleep('foo', 1000);
yield sleep('bar', 1000);
yield sleep('baz', 1000);
}

const serializer = new Serializer({
globalIdentifier: 'X',
onData(value) {
console.log(value);
},
});

serializer.write('example', example());

0 comments on commit 7b03f61

Please sign in to comment.