What is the main difference between ReactiveCocoa and PromiseKit?

ReactiveCocoa uses RACSignal and PromiseKit, using Promise to carry values. They can combine asynchronous work together. What is the main difference in the design of ReactiveCocoa and PromiseKit?

+4
source share
1 answer
Signals

and promises are both ways of representing asynchronous operations as input values ​​that can be transmitted, encoded, composed, nested, etc. in ways that cannot be called by a call / notification / delegate.

, promises , promises. - .

, . - - ,

--------------------Event(eventData)-Completion()

--------------Completion()

Event(eventData)---------Event(eventData)----------Failure(errorData)

-------------------------------------Failure(errorData)

. promises:

-------Completion(eventData)

----------------------------------------------Completion(eventData)

--------Failure(errorData)

------------------------Failure(errorData)

, , , , , :

-------Event(data)+Completion()

-------------------------------------------Event(data)+Completion()

--------Failure(errorData)

------------------------Failure(errorData)
+5

Source: https://habr.com/ru/post/1624716/


All Articles