ReactiveCocoa / ReactiveViewModel

Model-View-ViewModel, using ReactiveCocoa
MIT License
1.96k stars 259 forks source link

What's the meaning of -forwardSignalWhileActive: ? #12

Closed limboy closed 10 years ago

limboy commented 10 years ago

don't quite get the idea. can't we just do

[[self didBecomeActiveSignal] subscribeNext: ^(id x)];
jspahrsummers commented 10 years ago

-forwardSignalWhileActive: will subscribe to a signal when the view model becomes active, and dispose of that subscription when it becomes inactive. This means that work can easily be started and canceled in accordance with the view model's active state.

Also, anything that avoids explicit subscription is a good thing.

limboy commented 10 years ago

@jspahrsummers thanks 4 ur answer, much clearer.