diff --git a/src/sagas/lwp3-bootloader.ts b/src/sagas/lwp3-bootloader.ts index f359628d..35c4657b 100644 --- a/src/sagas/lwp3-bootloader.ts +++ b/src/sagas/lwp3-bootloader.ts @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT // Copyright (c) 2020 The Pybricks Authors -import { Channel, buffers } from 'redux-saga'; +import { Channel } from 'redux-saga'; import { actionChannel, fork, put, take, takeEvery } from 'redux-saga/effects'; import { Action } from '../actions'; import { @@ -51,12 +51,10 @@ import { hex } from '../utils'; function* encodeRequest(): Generator { // Using a while loop to serialize sending data to avoid "busy" errors. - const chan = (yield actionChannel( - (a: Action) => - Object.values(BootloaderRequestActionType).includes( - a.type as BootloaderRequestActionType, - ), - buffers.expanding(), + const chan = (yield actionChannel((a: Action) => + Object.values(BootloaderRequestActionType).includes( + a.type as BootloaderRequestActionType, + ), )) as Channel; while (true) { const action = (yield take(chan)) as BootloaderRequestAction; diff --git a/src/sagas/terminal.ts b/src/sagas/terminal.ts index 14898304..3a292f07 100644 --- a/src/sagas/terminal.ts +++ b/src/sagas/terminal.ts @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT // Copyright (c) 2020 The Pybricks Authors -import { Channel, buffers } from 'redux-saga'; +import { Channel } from 'redux-saga'; import { actionChannel, delay, @@ -24,10 +24,9 @@ const encoder = new TextEncoder(); const terminalDataSource = new PushStream(); function* receiveTerminalData(): Generator { - const channel = (yield actionChannel( - TerminalActionType.ReceivedData, - buffers.expanding(), - )) as Channel; + const channel = (yield actionChannel(TerminalActionType.ReceivedData)) as Channel< + TerminalDataReceiveDataAction + >; while (true) { // wait for input from terminal const action = (yield take(channel)) as TerminalDataReceiveDataAction;