8000 GitHub - RACCommunity/Rex at v0.4.0
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

RACCommunity/Rex

Repository files navigation

Rex Carthage compatible

Extensions for ReactiveCocoa that may not fit in the core framework. This currently targets Swift 1.2, for Swift 2 support see the swift2 branch.

Signal

All Signal operators can also be lifted toSignalProducer.

filterMap

Applies transform to values from signal with non-nil results unwrapped and forwared on the returned signal. This is equivalent to map { … } |> filter { $0 != nil } |> map { $0! } but without creating extra intermediate signals.

func filterMap<T, U, E>(transform: T -> U?)(signal: Signal<T, E>) -> Signal<U, E>
ignoreError

Wraps a signal in a version that drops Error events. By default errors are replaced with a Completed event but Interrupted can also be specified as replacement.

func ignoreError<T, E>(signal: Signal<T, E>) -> Signal<T, NoError>
func ignoreError<T, E>(#replacement: Event<T, NoError>)(signal: Signal<T, E>) -> Signal<T, NoError>
timeoutAfter

Forwards events from signal until it terminates or until interval time passes. This is nearly identical to timeoutWithError from RAC except any terminating event can be used for the timeout.

func timeoutAfter<T, E>(interval: NSTimeInterval, withEvent event: Event<T, E>, onScheduler scheduler: DateSchedulerType) -> Signal<T, E> -> Signal<T, E>
uncollect

Flattens batches of elements sent on signal into each individual element. The inverse of collect.

func uncollect<S: SequenceType, E>(signal: Signal<S, E>) -> Signal<S.Generator.Element, E>

SignalProducer

Operators specific to SignalProducer.

groupBy

Partitions values from producer into new producer groups based on the key returned from grouping. Termination events on the original producer are forwarded to each inner producer group.

func groupBy<K: Hashable, T, E>(grouping: T -> K)(producer: SignalProducer<T, E>)
  -> SignalProducer<(K, SignalProducer<T, E>), E>

Property

Extensions for creating properties from signals. These are curried to support chaining with |>.

propertyOf

Creates a new property bound to the provided signal/producer starting with initialValue.

func propertyOf<T>(initialValue: T)(signal: Signal<T, NoError>) -> PropertyOf<T>
func propertyOf<T>(initialValue: T)(producer: SignalProducer<T, NoError>) -> PropertyOf<T>
propertySink

Wraps sink in a property bound to the provided signal/producer. Values sent on signal are put into the sink to update it.

func propertySink<S: SinkType>(sink: S)(signal: Signal<S.Element, NoError>) -> PropertyOf<S>
func propertySink<S: SinkType>(sink: S)(producer: SignalProducer<S.Element, NoError>) -> PropertyOf<S>

License

Rex is released under the MIT license

About

ReactiveCocoa Extensions

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 21

Languages

0