mirror of
https://github.com/pybricks/pybricks-code.git
synced 2026-09-12 01:23:52 +00:00
remove use of thunk action in ble and hub
This is a step towards moving these to sagas
This commit is contained in:
committed by
David Lechner
parent
99fd62100d
commit
24acab901c
+1
-1
@@ -26,7 +26,7 @@ const disconnect: Epic = (action$) =>
|
||||
|
||||
const rxUartData: Epic<AnyAction, AnyAction, RootState> = (action$, state$) =>
|
||||
action$.pipe(
|
||||
ofType<AnyAction, BLEDataAction>(BLEDataActionType.ReceivedData),
|
||||
ofType<AnyAction, BLEDataAction>(BLEDataActionType.Notify),
|
||||
map((a) => {
|
||||
if (
|
||||
state$.value.hub.runtime === HubRuntimeState.Loading &&
|
||||
|
||||
+2
-2
@@ -5,13 +5,13 @@ import { AnyAction } from 'redux';
|
||||
import { Epic, combineEpics, ofType } from 'redux-observable';
|
||||
import { Subject } from 'rxjs';
|
||||
import { ignoreElements, take, tap } from 'rxjs/operators';
|
||||
import { HubActionType, HubChecksumAction } from '../actions/hub';
|
||||
import { HubChecksumMessageAction, HubMessageActionType } from '../actions/hub';
|
||||
|
||||
const checksumSubject = new Subject<number>();
|
||||
|
||||
const checksum: Epic = (action$) =>
|
||||
action$.pipe(
|
||||
ofType<AnyAction, HubChecksumAction>(HubActionType.Checksum),
|
||||
ofType<AnyAction, HubChecksumMessageAction>(HubMessageActionType.Checksum),
|
||||
tap((a) => checksumSubject.next(a.checksum)),
|
||||
ignoreElements(),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user