Skip to content
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

Possible bug in remote-data-io.ts #31

Closed
gcanti opened this issue May 7, 2019 · 1 comment · Fixed by #32
Closed

Possible bug in remote-data-io.ts #31

gcanti opened this issue May 7, 2019 · 1 comment · Fixed by #32
Assignees
Labels
bug Something isn't working

Comments

@gcanti
Copy link

gcanti commented May 7, 2019

I think I found a bug while trying to upgrade this library to fp-ts@2

Here

JSONProgress.encode outputs a { loaded: number; total: number | null; } | null but should be a RemoteProgress | null and RemoteProgress is defined as

export type RemoteProgress = {
  loaded: number;
  total: Option<number>;
};

Repro

  • install io-ts-types@latest
  • open src/remote-data-io.ts in VSCode or try to compile the project, shouldn't type check
@raveclassic raveclassic self-assigned this May 14, 2019
@raveclassic raveclassic added the bug Something isn't working label May 14, 2019
@raveclassic
Copy link
Contributor

Thanks @gcanti
Yeah, this is because JSONRemoteData refers to RemoteProgress which uses Option in total field. Looks like this result in an error with latest io-ts-types. I'll fix it and release a minor with updated versions of all related libs.

raveclassic added a commit that referenced this issue May 26, 2019
* build(npm): run npm update

* style: update prettier

* build(npm): run npm audit fix --force

* build(npm): run npm dedupe

* fix: incorrect type for JSONPending (closes #31)
raveclassic added a commit that referenced this issue May 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants