Skip to content
`RxEventHub` makes multicasting event easy, type-safe and error-free, use it instead of `NSNotificationCenter` now!
Swift Objective-C Shell Ruby
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


CI Status Version License Platform


RxEventHub is an event hub in RxSwift world, it makes multicasting event easy, type-safe and error-free, it's intent to replace usage of NSNotificationCenter in most cases.

To make multicasting event type-safe and error-free, this lib provides RxEventProvider with generic type. For each type of event you want to send and observe, you create a subclass of RxEventProvider, just like below:

class ExampleIntEventProvider: RxEventProvider<Int>{}

This class is used to provide type info and event name. You may override the typeKey method to provide custom event name.

You can notify the hub when events occur by simply writing 1 line code like below:

RxEventHub.sharedHub.notify(ExampleIntEventProvider(), data: 2)

You can get the Observable (Observable<Int> in this example) when events occur by simply writing 1 line code like below:


One more thing, you can either use the default hub RxEventHub.sharedHub, or create different hubs for different modules as you want.


  • Swift 3 (use 0.1.1 version for Swift 2)



RxEventHub is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "RxEventHub"


Just copy RxEventHub.swift into your project, and you're ready to go.


RxEventHub is available under the MIT license. See the LICENSE file for more info.

You can’t perform that action at this time.