Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/stores/process.ts
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,12 @@ export function createProcess<T = any, P extends object = DefaultPayload>(
* Creates a process factory that will create processes with the specified callback decorators applied.
* @param callbackDecorators array of process callback decorators to be used by the return factory.
*/
export function createProcessFactoryWith(callbackDecorators: ProcessCallbackDecorator[]): CreateProcess {
return (id: string, commands: (Command[] | Command)[], callback?: ProcessCallback): Process => {
export function createProcessFactoryWith(callbackDecorators: ProcessCallbackDecorator[]) {
return <S, P extends object>(
id: string,
commands: (Command<S, P>[] | Command<S, P>)[],
callback?: ProcessCallback<S>
): Process<S, P> => {
const decoratedCallback = callbackDecorators.reduce((callback, callbackDecorator) => {
return callbackDecorator(callback);
}, callback);
Expand Down