drop FirmwareSagaContext

This context is not exclusive to the firmware sagas.
This commit is contained in:
David Lechner
2022-03-26 16:10:28 -05:00
parent 54a475cebc
commit 07a03d4ea7
3 changed files with 5 additions and 15 deletions
-1
View File
@@ -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
View File
@@ -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({