Skip to content

chronicqazxc/simple-reactive

Repository files navigation

SimpleReactive

CI Status Version License Platform

SimpleReactive is my experiment for demonstrate reactive programming.
demo

@IBOutlet weak var value2Display: UILabel!
@IBOutlet weak var value2Display2: UILabel!
let singal = SimpleColdSignal("")

override func viewDidLoad() {
    super.viewDidLoad()
    singal.bindTo(label: value2Display)
    singal.bindTo(label: value2Display2)
}

func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String) -> Bool {
    let nsString = textField.text as NSString?
    let newString = nsString?.replacingCharacters(in: range, with: string)
    singal.next(newString ?? "")
    return true
}

Example

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

Requirements

Installation

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

pod "SimpleReactive"

Author

Wayne Hsiao

License

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

About

A lightweight reactive programming framework in Swift.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published