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

WIP: failing test proving that inputs can't be empty #39

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

sweetleon
Copy link

TODO: implement a fix

TODO: implement a fix
@sweetleon sweetleon changed the title WIP: failing test proving that inputs can't be impty WIP: failing test proving that inputs can't be empty Jan 3, 2020
src/rxreact.tsx Outdated
@@ -30,7 +30,7 @@ function withViewModelFactory<S, A, P extends S & ActionMap<A>>(
constructor(props: Difference<P, S & ActionMap<A>>) {
super(props);
let viewModel = viewModelFactory(this.propsObservable);
this.observableState = combineObservables(viewModel.inputs);
this.observableState = Object.keys(viewModel.inputs).length ? combineObservables(viewModel.inputs) : new Observable();
Copy link
Owner

Choose a reason for hiding this comment

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

You need an observable that emits something.

I recommend using the of constructor -- you'll need to add it to the rxjs import above

Suggested change
this.observableState = Object.keys(viewModel.inputs).length ? combineObservables(viewModel.inputs) : new Observable();
this.observableState = Object.keys(viewModel.inputs).length ? combineObservables(viewModel.inputs) : of({});

@coveralls
Copy link

Pull Request Test Coverage Report for Build 884

  • 1 of 1 (100.0%) changed or added relevant line in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 100.0%

Totals Coverage Status
Change from base Build 26: 0.0%
Covered Lines: 35
Relevant Lines: 35

💛 - Coveralls

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.

3 participants