Skip to content

Commit

Permalink
build payloads without builder
Browse files Browse the repository at this point in the history
  • Loading branch information
jonesmac committed Dec 8, 2023
1 parent b8aec5e commit c0adda4
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions packages/sdk/packages/storybook/src/samplePayload.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
import { PayloadBuilder } from '@xyo-network/payload-builder'
import { Payload } from '@xyo-network/payload-model'
import { Payload } from '@xyo-network/payload-model';

export const samplePayloadFromBuilder = {
...new PayloadBuilder<Payload<{ schema: 'network.xyo.temp'; test: string }>>({ schema: 'network.xyo.temp' }).fields({ test: 'hello' }).build(),
type TestPayload = Payload<{
test: string
}, 'network.xyo.temp'>

// needs to be in a function since cjs doesn't support top level awaits
export const samplePayloadFromBuilder ={
...{ test: 'hello', schema: 'network.xyo.temp' } as TestPayload,
_archive: 'temp',
}

Expand Down

0 comments on commit c0adda4

Please sign in to comment.