mirror of
https://github.com/pybricks/pybricks-code.git
synced 2026-09-15 11:04:49 +00:00
actions: simplify usage of Matchable
This removes use of the pseudo-internal toString() function and also removes extraneous uses of ReturnType<>. Also, a new when() method is added to simplify additional uses.
This commit is contained in:
@@ -57,9 +57,8 @@ function* encodeRequest(): Generator {
|
||||
}
|
||||
|
||||
const { failedToSend } = yield* race({
|
||||
sent: take<ReturnType<typeof didWriteCommand>>(didWriteCommand),
|
||||
failedToSend:
|
||||
take<ReturnType<typeof didFailToWriteCommand>>(didFailToWriteCommand),
|
||||
sent: take(didWriteCommand),
|
||||
failedToSend: take(didFailToWriteCommand),
|
||||
});
|
||||
|
||||
if (failedToSend) {
|
||||
|
||||
Reference in New Issue
Block a user