Currently, ReSwift use in iOS. will it be useful for OSX application?
@steve21124 ReSwift itself is entirely platform agnostic. It should work very well for OS X applications as well. Actually @DivineDominion is working on an OS X example right now. It's still WIP but you can see it here: https://github.com/ReSwift/ReSwift-Todo-Example
We will aim to have good example for both OS X and iOS.
Thanks Ben.
Thanks for the link, pretty useful link to see how it is useful for OSX type application. I still try to see what type of OSX application will be useful using ReSwift
"Apps built upon MVC often end up with a lot of complexity around state management and propagation. We need to use callbacks, delegations, Key-Value-Observation and notifications to pass information around in our apps and to ensure that all the relevant views have the latest state."
"Want to collaborate with a co-worker on fixing an app crash? Use ReSwift Recorder to record the actions that lead up to the crash and send them the JSON file so that they can replay the actions and reproduce the issue right away."
This is attractive feature
there is RxSwift which state "It frees you from tangled webs of callbacks, and thereby makes your code more readable and less prone to bugs.". Is ReSwift try to tackle the same problem as RxSwift?
RxSwift chooses another implementation paradigm, but the goal's the same. ReSwift is currently less aimed at being a declarative approach where you use callbacks/ signals to model one piece of information flow. I'd say when RxSwift uses lots of functional reactive programming techniques, ReSwift is your good old object-oriented programming _applied properly and with care._
_Note: this is my opinion, not representative of the team although GitHub points out that I'm a member :)_
@steve21124 I would actually come up with a slightly different answer here.
RxSwift and ReSwift both try to tackle the problem of updating state in your applications. Both try to make this as _declarative_ as possible; this means you describe how State A relates to State B.
RxSwift does this on a lower level. It doesn't require a specific architecture, it simply gives you the tools to update state automatically through bindings and observers (which makes it more declarative) instead of relying on manually calling callbacks or delegate methods.
ReSwift tackles the same problem, but on the level of an application architecture. If you follow the ReSwift architecture you will always use Actions to update your application state and therefore will always us ReSwift's automatic state update flow instead of manually calling callbacks or delegate methods.
ReSwift and RxSwift also work really well together. Instead of implementing the newState method on your subscriber; you can wrap the Store into an Rx Observable and then use the RxSwift mechanics to get state updates (we will hopefully soon have an example for this).
TL;DR: Both tackle similar problems, both work well together. RxSwift provides a toolset, ReSwift suggests an architecture.
I'd say when RxSwift uses lots of functional reactive programming techniques, ReSwift is your good old object-oriented programming applied properly and with care.
ReSwift is based on Redux and therefore base on a lot of functional programming ideas (reducers as pure functions, declarative programming through actions, etc.).
However, IMO, neither RxSwift nor ReSwift impose an object oriented or a functional architecture onto the developer. It is really up to you how you use both of these libraries.
Thanks all for above comments. This will be super useful information. I think above comments can be put on ReadMe page. As most still new with swift way of state management and functional programming, there will be a lot of research in comparing state management framework or architecture design.
The next question is, will ReSwift be used in conjunction with MVC? from readme page, seems like it is either ReSwift or MVC?
Sounds like a good idea. We still have a bunch of stuff to optimize about our documentation. Here's another interesting way of describing difference between FRP and Redux:
@andrestaltz @dan_abramov reactive programming optimizes "when does stuff change", redux optimizes "what state is there".
— Ryan Florence (@ryanflorence) February 12, 2016
Seems like this question is resolved.
Is there any example in the meantime for what you stated with:
ReSwift and RxSwift also work really well together. Instead of implementing the newState method on your subscriber; you can wrap the Store into an Rx Observable and then use the RxSwift mechanics to get state updates (we will hopefully soon have an example for this).
I have an idea about it, but I would love to see more input.
Most helpful comment
@steve21124 I would actually come up with a slightly different answer here.
RxSwift and ReSwift both try to tackle the problem of updating state in your applications. Both try to make this as _declarative_ as possible; this means you describe how State A relates to State B.
RxSwift does this on a lower level. It doesn't require a specific architecture, it simply gives you the tools to update state automatically through bindings and observers (which makes it more declarative) instead of relying on manually calling callbacks or delegate methods.
ReSwift tackles the same problem, but on the level of an application architecture. If you follow the ReSwift architecture you will always use
Actions to update your application state and therefore will always us ReSwift's automatic state update flow instead of manually calling callbacks or delegate methods.ReSwift and RxSwift also work really well together. Instead of implementing the
newStatemethod on your subscriber; you can wrap theStoreinto an RxObservableand then use the RxSwift mechanics to get state updates (we will hopefully soon have an example for this).TL;DR: Both tackle similar problems, both work well together. RxSwift provides a toolset, ReSwift suggests an architecture.