diff --git a/packages/seroval/test.js b/packages/seroval/test.js index c912b686..8170b818 100644 --- a/packages/seroval/test.js +++ b/packages/seroval/test.js @@ -1,16 +1,22 @@ -import { serialize, Feature } from './dist/esm/development/index.mjs'; +import { Serializer } from './dist/esm/development/index.mjs'; -const example = [ - Symbol.iterator, - Symbol.iterator, - Symbol.iterator, - Symbol.iterator, - Symbol.iterator, -]; - -console.dir(serialize(example, { - disabledFeatures: Feature.ObjectAssign, -}), { - depth: null +const serializer = new Serializer({ + globalIdentifier: '__SOLID__', + onHeader(value) { + console.log('HEADER', value); + }, + onData(value) { + console.log([value]); + }, }); + +const delay = (value, ms) => new Promise(r => setTimeout(r, ms, value)); + +const source = { + a: delay('A', 300), + b: delay('B', 200), + c: delay('C', 100), +}; + +serializer.write('1', source);