mirror of
https://github.com/pybricks/pybricks-code.git
synced 2026-09-12 09:36:27 +00:00
drop FirmwareSagaContext
This context is not exclusive to the firmware sagas.
This commit is contained in:
@@ -6,7 +6,6 @@ import {
|
||||
FirmwareReaderError,
|
||||
FirmwareReaderErrorCode,
|
||||
} from '@pybricks/firmware';
|
||||
import { mock } from 'jest-mock-extended';
|
||||
import JSZip from 'jszip';
|
||||
import { AsyncSaga } from '../../test';
|
||||
import {
|
||||
|
||||
+1
-11
@@ -65,16 +65,6 @@ import {
|
||||
flashFirmware,
|
||||
} from './actions';
|
||||
|
||||
/**
|
||||
* Function that returns the next unused message ID.
|
||||
*/
|
||||
type NextMessageIdFunc = () => number;
|
||||
|
||||
/**
|
||||
* Partial saga context type for context used in the firmware sagas.
|
||||
*/
|
||||
export type FirmwareSagaContext = { nextMessageId: NextMessageIdFunc };
|
||||
|
||||
const firmwareZipMap = new Map<HubType, string>([
|
||||
[HubType.CityHub, cityHubZip],
|
||||
[HubType.TechnicHub, technicHubZip],
|
||||
@@ -305,7 +295,7 @@ function* handleFlashFirmware(action: ReturnType<typeof flashFirmware>): Generat
|
||||
return;
|
||||
}
|
||||
|
||||
const nextMessageId = yield* getContext<NextMessageIdFunc>('nextMessageId');
|
||||
const nextMessageId = yield* getContext<() => number>('nextMessageId');
|
||||
|
||||
const infoAction = yield* put(infoRequest(nextMessageId()));
|
||||
const { info } = yield* all({
|
||||
|
||||
Reference in New Issue
Block a user