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

io-ts type added #19

Merged
merged 4 commits into from
Nov 6, 2018
Merged

io-ts type added #19

merged 4 commits into from
Nov 6, 2018

Conversation

mlegenhausen
Copy link
Contributor

No description provided.

src/io-ts.ts Outdated
a =>
a.foldL<JSONRemoteData<OL, OR>>(
() => ({ type: 'Initial' }),
() => ({ type: 'Pending', progress: JSONProgress.encode((a as any).progress) }),
Copy link
Contributor Author

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.

@mlegenhausen
Copy link
Contributor Author

@raveclassic what do you think?

.travis.yml Outdated
@@ -1,5 +1,6 @@
language: node_js
node_js:
- "8"
- "10"
Copy link
Contributor

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';
Copy link
Contributor

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?

Copy link
Contributor Author

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"],
Copy link
Contributor

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?

Copy link
Contributor Author

@mlegenhausen mlegenhausen Oct 29, 2018

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",
Copy link
Contributor

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

Copy link
Contributor Author

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?

@raveclassic raveclassic merged commit 2a01fe0 into devexperts:master Nov 6, 2018
raveclassic pushed a commit that referenced this pull request Nov 6, 2018
add remote-data-io.ts with io-ts types
add index.ts

closes #19
raveclassic pushed a commit that referenced this pull request Nov 6, 2018
add remote-data-io.ts with io-ts types
add index.ts
raveclassic pushed a commit that referenced this pull request Nov 20, 2018
add remote-data-io.ts with io-ts types
add index.ts

BREAKING CHANGE: add io-ts and io-ts-types to peer-dependencies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants