-
Notifications
You must be signed in to change notification settings - Fork 28
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
io-ts type added #19
io-ts type added #19
Conversation
src/io-ts.ts
Outdated
a => | ||
a.foldL<JSONRemoteData<OL, OR>>( | ||
() => ({ type: 'Initial' }), | ||
() => ({ type: 'Pending', progress: JSONProgress.encode((a as any).progress) }), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could be fixed with #20.
@raveclassic what do you think? |
.travis.yml
Outdated
@@ -1,5 +1,6 @@ | |||
language: node_js | |||
node_js: | |||
- "8" | |||
- "10" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you need Node 10 here?
src/index.ts
Outdated
@@ -0,0 +1,2 @@ | |||
export * from './io-ts'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what about naming it remote-data-io.ts
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure.
@@ -2,6 +2,7 @@ | |||
"compilerOptions": { | |||
"module": "commonjs", | |||
"target": "es5", | |||
"lib": ["es6", "dom"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you please point what does it solve?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I run npm run build
I get the following errors:
node_modules/io-ts-types/lib/fp-ts/createSetFromArray.d.ts:9:163 - error TS2304: Cannot find name 'Set'.
9 export declare const createSetFromArray: <RT extends t.Type<A, O, t.mixed>, A = any, O = A>(type: RT, ordA: Ord<RT["_A"]>, name?: string) => SetFromArrayType<RT, Set<RT["_A"]>, RT["_O"][], t.mixed>;
This can be solved by adding es6
. Now I get another error.
src/__tests__/remote-data.spec.ts:478:18 - error TS2304: Cannot find name 'ProgressEvent'.
478 const e = new ProgressEvent('test');
~~~~~~~~~~~~~
src/remote-data.ts:916:48 - error TS2304: Cannot find name 'ProgressEvent'.
916 export function fromProgressEvent<L, A>(event: ProgressEvent): RemoteData<L, A> {
~~~~~~~~~~~~~
src/remote-data.ts:916:48 - error TS4078: Parameter 'event' of exported function has or is using private name 'ProgressEvent'.
916 export function fromProgressEvent<L, A>(event: ProgressEvent): RemoteData<L, A> {
which I can be solved by adding dom
.
@@ -1,8 +1,8 @@ | |||
{ | |||
"name": "@devexperts/remote-data-ts", | |||
"version": "0.3.1", | |||
"main": "dist/remote-data.js", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
breaking change - just a note
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You mean when someone reference the file directly?
add remote-data-io.ts with io-ts types add index.ts closes #19
add remote-data-io.ts with io-ts types add index.ts
add remote-data-io.ts with io-ts types add index.ts BREAKING CHANGE: add io-ts and io-ts-types to peer-dependencies
No description provided.