-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Regression in latest release? (when upgrading from 1.4 to 1.5) #677
Comments
I think this is related: import { call } from "typed-redux-saga";
interface DownloadFileProgress {
onDownloadProgress: (data: { total: number; loaded: number }) => void;
}
export const downloadAudioFile = function* (
fileId: string,
{ onDownloadProgress }: Partial<DownloadFileProgress>
) {
// download file
};
function* test() {
yield* call(downloadAudioFile, "some-id", {
// total and loaded is any
onDownloadProgress: ({ total, loaded }) => {
}
});
} in in https://codesandbox.io/s/billowing-water-vlnhey?file=/src/index.ts |
Hello everyone! I still think there is some regression with string literals: import { call } from 'typed-redux-saga';
import { SagaIterator } from 'redux-saga';
type StringLiteral = 'GET' | 'POST' | 'PUT' | 'DELETE';
type ObjectWithLiteral = {
method: StringLiteral,
};
function simpleOne(object: ObjectWithLiteral): StringLiteral {
return object.method;
}
function* generator(object: ObjectWithLiteral): SagaIterator<StringLiteral> {
return object.method;
}
function* test(): SagaIterator<void> {
// shows error
const a = yield* call(simpleOne, {method: 'GET'});
// shows error
const b = yield* call(generator, {method: 'GET'});
}
// do not show error, which is correct behaviour according to latest typescript
simpleOne({method: 'GET'}); |
I have the same problem (version 1.5) - I'm using untyped |
We have had to stay on |
Hi,
I added a PR with two examples of cases that started failing for us when trying to apply the update: #675
The smallest case looks like this:
This code works in 1.4 but in 1.5 the argument to the function
call
ed (27) gets interpreted as number (instead of that specific number it seems?)Has anyone else had this problem? ideas to fix it?
The text was updated successfully, but these errors were encountered: