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

refactor: Factories: API #925

Merged
merged 13 commits into from
Dec 20, 2018
Merged

refactor: Factories: API #925

merged 13 commits into from
Dec 20, 2018

Conversation

kennylavender
Copy link
Contributor

@kennylavender kennylavender commented Dec 13, 2018

PR Process - PR Review Checklist

Release

Semantic release is enabled for this repository. Make sure you follow the right commit message convention.
We're using semantic-release's default — Angular Commit Message Conventions.

Description of Changes

resolves #924

@kennylavender
Copy link
Contributor Author

Having some issues with the file controller interface, will continue to work on it.

Type '(x?: ReadonlyArray<ReadStream>) => Promise<{}>' is not assignable to type '(fileStreams: ReadonlyArray<ReadStream>) => Promise<ReadonlyArray<{ hash: string; }>>'.
  Type 'Promise<{}>' is not assignable to type 'Promise<ReadonlyArray<{ hash: string; }>>'.
    Type '{}' is missing the following properties from type 'ReadonlyArray<{ hash: string; }>': length, concat, join, slice, and 17 more.ts(2322)
const addFiles: (fileStreams: ReadonlyArray<fs.ReadStream>) => Promise<ReadonlyArray<{
    hash: string;
}>>

@kennylavender kennylavender self-assigned this Dec 13, 2018
@kennylavender
Copy link
Contributor Author

kennylavender commented Dec 14, 2018

Ok, think I've got the types figured out. TS was inferring some types incorrectly in handleFile, so I added manual typings. TS was also having issues with ramda's map, and it also had issues with Promise.all.bind(Promise) so I had to adjust those functions those things inside of addFiles

log(LogTypes.trace)('Adding files'),
(xs) => xs.map(handleFile),
(xs) => Promise.all(xs),
(xs) => log(LogTypes.trace)('Added files')(xs),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For some really weird reason, I have to give this a function like this... It doesn't make any sense. It might have more to do with the asyncPipe weirdness I've been seeing. Il experiment with pipeP

@lautarodragan lautarodragan merged commit 3bf1e9c into master Dec 20, 2018
@lautarodragan lautarodragan deleted the kenny-#924 branch December 20, 2018 02:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Factories Refactor: API
3 participants