ReactiveArray alternatives and similar libraries
Based on the "Reactive Programming" category.
Alternatively, view ReactiveArray alternatives based on common mentions on social networks and blogs.
-
ReactiveCocoa
Cocoa framework and Obj-C dynamism bindings for ReactiveSwift. -
OpenCombine
Open source implementation of Apple's Combine framework for processing values over time. -
Render
UIKit a-lร SwiftUI.framework [min deployment target iOS10] -
Katana
Swift Apps in a Swoosh! A modern framework for creating iOS apps, inspired by Redux. -
RxCoordinator
๐ Powerful navigation library for iOS based on the coordinator pattern -
RxAlamofire
RxSwift wrapper around the elegant HTTP networking in Swift Alamofire -
Interstellar
Simple and lightweight Functional Reactive Coding in Swift for the rest of us. :large_orange_diamond: -
RxAutomaton
๐ค RxSwift + State Machine, inspired by Redux and Elm. -
NSObject-Rx
Handy RxSwift extensions on NSObject, including rx.disposeBag. -
Verge
๐ฃ A robust Swift state-management framework designed for complex applications, featuring an integrated ORM for efficient data handling. -
RxMediaPicker
A reactive wrapper built around UIImagePickerController. -
VueFlux
:recycle: Unidirectional State Management Architecture for Swift - Inspired by Vuex and Flux -
Komponents ๐ฆ
๐ฆ React-inspired UIKit Components - โ ๏ธ Deprecated -
ReactiveTask
Flexible, stream-based abstraction for launching processes -
TemplateKit
React-inspired framework for building component-based user interfaces in Swift. -
RxReduce
Lightweight framework that ease the implementation of a state container pattern in a Reactive Programming compliant way. -
LightweightObservable
๐ฌ A lightweight implementation of an observable sequence that you can subscribe to. -
RxMultipeer
A testable RxSwift wrapper around MultipeerConnectivity -
Aftermath
:crystal_ball: Stateless message-driven micro-framework in Swift. -
SimpleApiClient
A configurable api client based on Alamofire4 and RxSwift4 for iOS. -
OneWay
A Swift library for state management with unidirectional data flow. -
ACKReactiveExtensions
Set of useful extensions for ReactiveSwift & ReactiveCocoa -
ReactiveLocation
ReactiveCocoa wrapper for CLLocationManager. -
STDevRxExt
STDevRxExt contains some extension functions for RxSwift and RxCocoa which makes our live easy. -
BindKit
Two-way data binding framework for iOS. Only one API to learn. -
RxOptional
RxSwift extentions for Swift optionals and "Occupiable" types -
RxAlamoRecord
RxAlamoRecord combines the power of the AlamoRecord and RxSwift libraries to create a networking layer that makes interacting with API's easier than ever reactively.
Appwrite - The open-source backend cloud platform
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of ReactiveArray or a related project?
README
ReactiveArray
An array class implemented in Swift that can be observed using ReactiveCocoa's Signals.
Installation
Carthage
Add the following to your Cartfile:
github "Wolox/ReactiveArray"
Then run carthage update
.
Follow the current instructions in Carthage's README for up to date installation instructions.
You'll also need to add Result.framework
, Box.framework
and ReactiveCocoa.framework
to your Xcode
project.
Usage
Array operations
let array = ReactiveArray(elements: [1,2,3])
array.append(4) // => [1,2,3,4]
array.append(5) // => [1,2,3,4,5]
array[0] = 5 // => [5,2,3,4,5]
array.removeAtIndex(4) // => [5,2,3,4]
ReactiveArray
conforms to CollectionType
and MutableCollectionType
which allows you to perform operations like
map
or filter
.
Observing changes
The array can be observed for mutations using the signal
or producer
properties. Both Signal
and SignalProducer
will emit Operation
values on observation for any of the mutating
operations performed to the array.
Operation
is an enumeration with four cases. One for each
mutating operation: Append
, Insert
, Update
and RemoveElement
Using SignalProducer
Prints an append operation for each element that has already been stored in the array and then the corresponding operation for any new operation performed to the array.
let array = ReactiveArray(elements: [1,2,3])
array.producer |> start(next: { println($0) })
array[0] = 5
array[1] = 4
array.append(2)
array.removeAtIndex(2)
will print the following output:
.Append(value: 1)
.Append(value: 2)
.Append(value: 3)
.Update(value: 5, atIndex: 0)
.Update(value: 4, atIndex: 1)
.RemoveElement(atIndex:2)
Using Signal
The signal property will only emit values for operations performed in the array after observation.
let array = ReactiveArray(elements: [1,2,3])
array.signal.observe { println($0) }
array[0] = 5
array[1] = 4
array.append(2)
array.removeAtIndex(2)
will print the following output:
.Update(value: 5, atIndex: 0)
.Update(value: 4, atIndex: 1)
.RemoveElement(atIndex:2)
Using observableCount
You can also observe the observableCount
property that exposes a producer that emits the current amount of elements each time the array is mutated.
let array = ReactiveArray<String>()
array.observableCount.producer |> start(next: { println($0) })
array.append("Hello")
array.append("World")
will print the following output:
0
1
2
Mirror
Mirror creates a new ReactiveArray
by applying a transform
operation for each element contained in the original array. It is like map
but the returned array will mutate everytime the original array mutates.
let array = ReactiveArray(elements: [1,2,3])
let doubles = array.mirror { $0 * 2 }
doubles.producer |> start(next: { println($0) })
array.append(4)
array.append(5)
array[0] = 6
will print the following output:
.Append(value: 2)
.Append(value: 4)
.Append(value: 6)
.Append(value: 8)
.Append(value: 10)
.Update(value: 12, atIndex: 0)
Contributing
Setup project
If you want to contribute you need to setup your development environment first.
git clone https://github.com/Wolox/ReactiveArray.git
cd ReactiveArray
script/bootstrap
open ReactiveArray.xcodeproj
Environment dependencies
The following dependencies must be installed in your development machine.
- XCode & XCode command line tools
- Homebrew
- Ruby
- Bundler (sudoless)
- Carthage
- Gcovr
- SwiftCov
About
This project is maintained by Guido Marucci Blas and it was written by Wolox.
License
ReactiveArray is available under the MIT license.
Copyright (c) 2015 Guido Marucci Blas <[email protected]>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*Note that all licence references and agreements mentioned in the ReactiveArray README section above
are relevant to that project's source code only.