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

Create a state stream as the action property being accessed #49

Merged
merged 2 commits into from Nov 17, 2017

Conversation

creasty
Copy link
Contributor

@creasty creasty commented Nov 17, 2017

Why

If the state weren't subscribed from anywhere, actions sent to Reactor would be simply ignored.

func bind(reactor: Reactor) {
        reactor.action.onNext(.load)
}

What

Touch state property in action property to ensure the initialization of the state stream

@creasty
Copy link
Contributor Author

creasty commented Nov 17, 2017

cc @hedjirog

@codecov-io
Copy link

codecov-io commented Nov 17, 2017

Codecov Report

Merging #49 into master will increase coverage by 0.04%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #49      +/-   ##
==========================================
+ Coverage   91.91%   91.95%   +0.04%     
==========================================
  Files           7        7              
  Lines         198      199       +1     
  Branches       26       26              
==========================================
+ Hits          182      183       +1     
  Misses         14       14              
  Partials        2        2
Impacted Files Coverage Δ
Sources/ReactorKit/Reactor.swift 79.16% <100%> (+0.29%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1fd88d7...85cc80d. Read the comment docs.

@devxoul
Copy link
Member

devxoul commented Nov 17, 2017

Oh my god. I have no idea why I haven't try this approach. I really love this. Thanks! (cc. @innocarpe)

By the way, there is a generic subclassing bug(#30). I'll fix that after merging this. Thanks again!

@devxoul devxoul merged commit a86450d into ReactorKit:master Nov 17, 2017
devxoul added a commit that referenced this pull request Nov 17, 2017
devxoul added a commit that referenced this pull request Nov 17, 2017
Fix a generic subclassing bug occurred in #49
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.

None yet

3 participants