All Projects → tailec → Combineexamples

tailec / Combineexamples

Getting started with Apple Combine

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Combineexamples

Rxjava Android Samples
Learning RxJava for Android by example
Stars: ✭ 7,520 (+5086.21%)
Mutual labels:  reactive, reactive-programming
Rocket.jl
Functional reactive programming extensions library for Julia
Stars: ✭ 69 (-52.41%)
Mutual labels:  reactive, reactive-programming
Rxdownloader
- Reactive Extension Library for Android to download files
Stars: ✭ 40 (-72.41%)
Mutual labels:  reactive, reactive-programming
Reactivemanifesto
The Reactive Manifesto
Stars: ✭ 542 (+273.79%)
Mutual labels:  reactive, reactive-programming
Rsocket Rpc Java
Standard RSocket RPC Java Implementation
Stars: ✭ 126 (-13.1%)
Mutual labels:  reactive, reactive-programming
Rxcombine
Bi-directional type bridging between RxSwift and Apple's Combine framework
Stars: ✭ 741 (+411.03%)
Mutual labels:  reactive, reactive-programming
Rxswift To Combine Cheatsheet
RxSwift to Apple’s Combine Cheat Sheet
Stars: ✭ 1,040 (+617.24%)
Mutual labels:  reactive, reactive-programming
Reactive Practice At Taobao
♨️ Reactive @ 淘宝 | Reactive实践、推动、落地的记录与大会分享 | Flow Arch(流式架构)/Reactive Programming(RP/反应式编程)
Stars: ✭ 314 (+116.55%)
Mutual labels:  reactive, reactive-programming
Beicon
Reactive Streams for ClojureScript
Stars: ✭ 133 (-8.28%)
Mutual labels:  reactive, reactive-programming
Lda Topic Modeling
A PureScript, browser-based implementation of LDA topic modeling.
Stars: ✭ 91 (-37.24%)
Mutual labels:  reactive, reactive-programming
Motion
Reactive frontend UI components for Rails in pure Ruby
Stars: ✭ 498 (+243.45%)
Mutual labels:  reactive, reactive-programming
Redux Most
Most.js based middleware for Redux. Handle async actions with monadic streams & reactive programming.
Stars: ✭ 137 (-5.52%)
Mutual labels:  reactive, reactive-programming
Rxjava2 Jdbc
RxJava2 integration with JDBC including Non-blocking Connection Pools
Stars: ✭ 360 (+148.28%)
Mutual labels:  reactive, reactive-programming
Lagom Example
Example usage of the Lagom Framework for writing Java-based microservices
Stars: ✭ 20 (-86.21%)
Mutual labels:  reactive, reactive-programming
Core
Most.js core event stream
Stars: ✭ 342 (+135.86%)
Mutual labels:  reactive, reactive-programming
Inferno Most Fp Demo
A demo for the ReactJS Tampa Bay meetup showing how to build a React+Redux-like architecture from scratch using Inferno, Most.js, reactive programmning, and various functional programming tools & techniques
Stars: ✭ 45 (-68.97%)
Mutual labels:  reactive, reactive-programming
Awesome Rxjs
A collection of awesome RxJS resources
Stars: ✭ 314 (+116.55%)
Mutual labels:  reactive, reactive-programming
Vueflux
♻️ Unidirectional State Management Architecture for Swift - Inspired by Vuex and Flux
Stars: ✭ 315 (+117.24%)
Mutual labels:  reactive, reactive-programming
Bulb
A reactive programming library for JavaScript.
Stars: ✭ 84 (-42.07%)
Mutual labels:  reactive, reactive-programming
Ayanami
🍭 A better way to react with state
Stars: ✭ 129 (-11.03%)
Mutual labels:  reactive, reactive-programming

CombineExamples

WIP

👷 🧱 🧰 🛠️
Getting started with Combine
A collection of simple examples using Apple Combine reactive framework

last commit open issues swift version platform license
Built with ❤︎ by Pawel Krawiec


Examples

LOGIN SCREEN

Simple user login validation

let credentials = Publishers
    .CombineLatest($username, $password) { ($0, $1) }
    .share()
credentials
    .map { uname, pass in
        uname.count >= 4 && pass.count >= 4
    }
    .prepend(false) // initial state
    .assign(to: \.isEnabled, on: loginButton)
    .cancelled(by: cancellableBag)
    // More in the example...


TIMER

Simplified stopwatch

Timer.publish(every: 0.1, on: .main, in: .default)
    .autoconnect()
    .scan(0, { (acc, _ ) in return acc + 1 })
    .map { $0.timeInterval }
    .replaceError(with: "")
    .eraseToAnyPublisher()
    .assign(to: \.currentTime, on: self)
    .cancelled(by: cancellableBag)
    // More in the example...


SEARCH

Browsing GitHub repositories

$query
    .throttle(for: 0.5, 
        scheduler: .main, 
           latest: true)
    .removeDuplicates()
    .map { query in
        return API().search(with: query)
            .retry(3)
            .eraseToAnyPublisher()
    }
    // More in the example...


AVAILABILITY

Check if your repository name is already taken

 $text
    .throttle(for: 0.5, scheduler: .main, latest: true)
    .map { text in
        API().search(with: text)
            .map { isAvailable in
                isAvailable ? "Name available" : "Name already taken"
            }
            .prepend("Checking...")
    }
    .switchToLatest()
    // More in the example...


Stay tuned. More examples coming.

Licence

MIT.

The Apple logo and the Combine framework are property of Apple Inc.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].