mirror of
https://github.com/pybricks/pybricks-code.git
synced 2026-09-12 01:23:52 +00:00
remove buffers.expanding()
according to the docs, this is the default
This commit is contained in:
committed by
David Lechner
parent
61a5eb6039
commit
367d8a6178
@@ -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<BootloaderRequestAction>;
|
||||
while (true) {
|
||||
const action = (yield take(chan)) as BootloaderRequestAction;
|
||||
|
||||
@@ -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<string>();
|
||||
|
||||
function* receiveTerminalData(): Generator {
|
||||
const channel = (yield actionChannel(
|
||||
TerminalActionType.ReceivedData,
|
||||
buffers.expanding(),
|
||||
)) as Channel<TerminalDataReceiveDataAction>;
|
||||
const channel = (yield actionChannel(TerminalActionType.ReceivedData)) as Channel<
|
||||
TerminalDataReceiveDataAction
|
||||
>;
|
||||
while (true) {
|
||||
// wait for input from terminal
|
||||
const action = (yield take(channel)) as TerminalDataReceiveDataAction;
|
||||
|
||||
Reference in New Issue
Block a user