Latest 0.1.0
Homepage https://github.com/gal-orlanczyk/go-reactive
License MIT
Platforms ios 9.0
Frameworks UIKit, XCTest
Authors

GoReactive – Work in Progress

Build Status
Version
License
Platform

GoReactive is a simple yet powerful reactive framework based on observable pattern.
It provides easy way to acheive many simple tasks like observing, binding and more.
Should be useful for many day to day tasks without adding too much complexity into the codebase.

GoReactive doesn’t handle events in different threads intentionly, the main point of this framework is to provide great functionality that is easily debugable and lightweight.

Documentation

Simple Usage


class ViewModel {
    let bindableProperty = Property<String?>(nil)
}

...

let viewModel = ViewModel()
// A group of cancelable subscriptions, 
// will handle disposing of all subscriptions when deinitialized.
let cancelableGroup = CancelableGroup()

@IBOutlet weak var bindableLabel: UILabel!
@IBOutlet weak var bindableTextField: UITextField!

...

// Can subscribe to changes
self.viewModel.bindableProperty.subscribe(onNext: { (value) in
    // handles subscription
}).add(to: self.cancelableGroup)

// Can bind one way
self.viewModel.bindableProperty
    .bind(to: self.bindableLabel.reactiveComponent.text)
    .add(to: self.cancelableGroup)

// Can bind two way
self.bindableTextField.reactiveComponent.text
    .bidirectionalBind(to: self.viewModel.bindableProperty)
    .add(to: self.cancelableGroup)

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

  • Xcode 10
  • Swift 4.2

Installation

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

pod 'GoReactive'

TODO

  • [ ] Combine observables operation
  • [ ] Map observable operation
  • [ ] Use KVO, notifications etc. with observable sequence
  • [ ] CI Pipeline for auto-deploy (version and docs on tags) and other improvements
  • [ ] Code coverage
  • [ ] SwiftLint
  • [ ] tvOS, macOS support

Author

Gal Orlanczyk, [email protected]

License

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

Latest podspec

{
    "name": "GoReactive",
    "version": "0.1.0",
    "summary": "Simple yet powerful observable pattern framework",
    "description": "Provides a simple and powerful api for observable pattern, can also be extended easily",
    "homepage": "https://github.com/gal-orlanczyk/go-reactive",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Gal Orlanczyk": "[email protected]"
    },
    "source": {
        "git": "https://github.com/gal-orlanczyk/go-reactive.git",
        "tag": "0.1.0"
    },
    "platforms": {
        "ios": "9.0"
    },
    "swift_version": "4.2",
    "frameworks": [
        "UIKit",
        "XCTest"
    ],
    "source_files": "Sources/**/*"
}

Pin It on Pinterest

Share This