Skip to content

Welshman Docs / @welshman/app / Thunks

Class: Thunks ​

Defined in: app/src/plugins/thunk.ts:355

Per-app thunk manager — the publish-side counterpart of Network. Owns the app's optimistic-publish history store and the queue that paces publishing. Reach it via app.use(Thunks); publish fills in the app (the acting user is derived from it), enqueues the thunk (optimistically writing it to the repository), and returns it.

Constructors ​

Constructor ​

new Thunks(app): Thunks

Defined in: app/src/plugins/thunk.ts:366

Parameters ​

app ​

IApp

Returns ​

Thunks

Properties ​

app ​

readonly app: IApp

Defined in: app/src/plugins/thunk.ts:366


history ​

history: Writable<Thunk[]>

Defined in: app/src/plugins/thunk.ts:356


queue ​

queue: TaskQueue<Thunk>

Defined in: app/src/plugins/thunk.ts:358

Methods ​

enqueue() ​

enqueue(thunk): void

Defined in: app/src/plugins/thunk.ts:381

Parameters ​

thunk ​

Thunk

Returns ​

void


flatten() ​

flatten(thunks): Iterable<Thunk>

Defined in: app/src/plugins/thunk.ts:420

Parameters ​

thunks ​

BaseThunk[]

Returns ​

Iterable<Thunk>


merge() ​

merge(thunks): MergedThunk

Defined in: app/src/plugins/thunk.ts:416

Parameters ​

thunks ​

BaseThunk[]

Returns ​

MergedThunk


publish() ​

publish(options): Thunk

Defined in: app/src/plugins/thunk.ts:403

Parameters ​

options ​

Omit<ThunkOptions, "app">

Returns ​

Thunk


retry() ​

retry(thunk): Thunk | MergedThunk

Defined in: app/src/plugins/thunk.ts:411

Parameters ​

thunk ​

BaseThunk

Returns ​

Thunk | MergedThunk