# Combine Framework

**URL:** <https://forums.swift.org/t/combine-framework/25228>\
**Category:** Core Libraries\
**Created:** [June 4, 2019, 8:15pm UTC](https://forums.swift.org/t/combine-framework/25228 "2019-06-04T20:15:34Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![frameworklabs](https://avatars.discourse-cdn.com/v4/letter/f/13edae/32.png) [@frameworklabs](https://forums.swift.org/u/frameworklabs)\
**Post date:** [June 4, 2019, 8:15pm UTC](https://forums.swift.org/t/combine-framework/25228/1 "2019-06-04T20:15:34Z")

</div>

Apple has presented Combine - a reactive stream library: [Apple Developer Documentation](https://developer.apple.com/documentation/combine)

Thats a great addition - my questions might be:

- Will this be part of the Core Libraries or Standard library?
- Why didn't it go beyond what existing Rx libraries provide?

To the last point: We introduced the `Result` type so that we don't have to deal with 2 entry points (success and failure) in callbacks. Combine has separate entry points for success, failure and finished events. Why not consolidate this using the Result type?

Also, I would have hoped that Swifts version of Rx is more approachable - by using better namings. People new to reactive programming will be irritated by names like `Subject`, `CurrentValueSubject`. Maybe something like `Signal` and `Property` are more accessible to a broader audience.

---

<div class="post-metadata">

**Author:** ![sveinhal](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/sveinhal/32/3992_2.png) [@sveinhal](https://forums.swift.org/u/sveinhal)\
**Post date:** [June 4, 2019, 8:39pm UTC](https://forums.swift.org/t/combine-framework/25228/2 "2019-06-04T20:39:32Z")

</div>

> [@frameworklabs](#):
>
> Swifts version of Rx

This is an Apple framework written in Swift, but not part of the Swift project.

---

<div class="post-metadata">

**Author:** ![pgorzelany](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/pgorzelany/32/368_2.png) [@pgorzelany](https://forums.swift.org/u/pgorzelany)\
**Post date:** [June 4, 2019, 9:12pm UTC](https://forums.swift.org/t/combine-framework/25228/3 "2019-06-04T21:12:25Z")

</div>

There already is an open source Swift version of Rx ([GitHub - ReactiveX/RxSwift: Reactive Programming in Swift](https://github.com/ReactiveX/RxSwift)). I guess combine is similar but does not follow the ReactiveX API.  
For now, it is closed source and not cross-platform. Let's hope that Apple will open source it at some point and make it work on all Swift supported platforms.

---

<div class="post-metadata">

**Author:** ![ktoso](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/ktoso/32/44526_2.png) [@ktoso](https://forums.swift.org/u/ktoso)\
**Post date:** [June 6, 2019, 1:02am UTC](https://forums.swift.org/t/combine-framework/25228/4 "2019-06-06T01:02:21Z")

</div>

A core and important difference is that Combine is based and built around the concepts of back-pressure (aka. flow-control) as established by [https://www.reactive-streams.org](https://www.reactive-streams.org) (as Tony mentioned in [Will SwiftNIO adapt to the new Combine framework? - #11 by Tony\_Parker](https://forums.swift.org/t/will-swiftnio-adapt-to-the-new-combine-framework/25166/11)). It makes it somewhat of a "different beast" from an execution models perspective -- even if APIs seem quite similar.

I for one, am tremendously excited for the acknowledgement and solution (in Combine) of the need of asynchronous back-pressure in streaming -- it shows up in many many places after all 🙂

---

<div class="post-metadata">

**Author:** ![Spencer\_Kohan](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/spencer_kohan/32/4505_2.png) [@Spencer\_Kohan](https://forums.swift.org/u/Spencer_Kohan)\
**Post date:** [June 6, 2019, 9:20am UTC](https://forums.swift.org/t/combine-framework/25228/5 "2019-06-06T09:20:28Z")

</div>

> [@frameworklabs](#):
>
> Also, I would have hoped that Swifts version of Rx is more approachable - by using better namings.

+1 on this sentiment. I've always felt that the ReactiveX API is unnecessarily esoteric and this would be a good opportunity to iterate on it.

---

<div class="post-metadata">

**Author:** ![Karl](https://avatars.discourse-cdn.com/v4/letter/k/34f0e0/32.png) [@Karl](https://forums.swift.org/u/Karl)\
**Post date:** [June 6, 2019, 9:12pm UTC](https://forums.swift.org/t/combine-framework/25228/6 "2019-06-06T21:12:37Z")

</div>

I haven't had a chance to look in to it in much detail yet, but broadly-speaking, I quite like the design of Combine.

I definitely think it is a good candidate for inclusion in the open-source project in some form (either as a corelib or as part of the standard library). There is nothing really magical about it - there are already plenty of reactive-stream libraries - but there would be a lot of value in standardising around a blessed library and common currency types.

It all depends if Apple is _open_ to it or not (pun intended). Otherwise I suspect existing libraries like ReactiveX will continue to be preferred for cross-platform code with some kind of wrapper for when their streams end up in Apple-land. It would benefit all Swift code on all platforms if we could avoid that bifurcation.

We don't even need their implementation, just permission to use the API (since [APIs are copyrightable](http://www.gsnh.com/copyright-protection-apis/)).
