All Projects โ†’ SebastianBoldt โ†’ Bird

SebastianBoldt / Bird

Licence: MIT license
๐Ÿค Bird is a lightweight HTTP networking library written in Swift. It is based on Apples new Reactive Framework Combine and focused on maintain- and extendability.

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Bird

SwiftObserver
Elegant Reactive Primitives for Clean Swift Architecture #NoRx
Stars: โœญ 14 (-17.65%)
Mutual labels:  reactive, combine
reactive-extensions
Extensions to the dotnet/reactive library.
Stars: โœญ 46 (+170.59%)
Mutual labels:  reactive
purescript-pop
๐Ÿ˜ƒ A functional reactive programming (FRP) demo created with PureScript events and behaviors.
Stars: โœญ 33 (+94.12%)
Mutual labels:  reactive
dirty-leds
Music reactive WS2812b LEDs with an ESP8266
Stars: โœญ 24 (+41.18%)
Mutual labels:  reactive
StockBar
A menu bar app to track stock prices, currency exchange rates, and cryptocurrency prices.
Stars: โœญ 17 (+0%)
Mutual labels:  combine
immerx-state
Reactive, fractal and no-nonsense state management with Immer
Stars: โœญ 19 (+11.76%)
Mutual labels:  reactive
staballoy
Reactive UI framework for Titanium Alloy
Stars: โœญ 18 (+5.88%)
Mutual labels:  reactive
reactive-rs
Streams and broadcasts: functional reactive programming in Rust.
Stars: โœญ 28 (+64.71%)
Mutual labels:  reactive
statechart
A rust implementation of statecharts: hierarchical, reactive state machines
Stars: โœญ 41 (+141.18%)
Mutual labels:  reactive
rxjava2-http
Transmit RxJava2 Flowable over http with non-blocking backpressure
Stars: โœญ 19 (+11.76%)
Mutual labels:  reactive
reactive-search
Incremental search using React and RxJS
Stars: โœญ 15 (-11.76%)
Mutual labels:  reactive
vertx-codegen
Vert.x code generator for asynchronous polyglot APIs
Stars: โœญ 95 (+458.82%)
Mutual labels:  reactive
Rick-and-Morty-iOS-App
This is a sample iOS 13+ UIKit - Combine project.
Stars: โœญ 21 (+23.53%)
Mutual labels:  combine
ifunny
ะ ะตัˆะตะฝะธะต ะดะปั ะบะพะฝะบัƒั€ัะฐ FunCode Java/Kotlin Challenge
Stars: โœญ 25 (+47.06%)
Mutual labels:  reactive
Reactive.XAF
DevExpress XAF extension framework. ๐—น๐—ถ๐—ป๐—ธ๐—ฒ๐—ฑ๐—ถ๐—ป.๐—ฒ๐˜…๐—ฝ๐—ฎ๐—ป๐—ฑ๐—ณ๐—ฟ๐—ฎ๐—บ๐—ฒ๐˜„๐—ผ๐—ฟ๐—ธ.๐—ฐ๐—ผ๐—บ, ๐˜†๐—ผ๐˜‚๐˜๐˜‚๐—ฏ๐—ฒ.๐—ฒ๐˜…๐—ฝ๐—ฎ๐—ป๐—ฑ๐—ณ๐—ฟ๐—ฎ๐—บ๐—ฒ๐˜„๐—ผ๐—ฟ๐—ธ.๐—ฐ๐—ผ๐—บ and ๐˜๐˜„๐—ถ๐˜๐˜๐—ฒ๐—ฟ @๐—ฒ๐˜…๐—ฝ๐—ฎ๐—ป๐—ฑ๐—ณ๐—ฟ๐—ฎ๐—บ๐—ฒ๐˜„๐—ผ๐—ฟ๐—ธ and or simply ๐—ฆ๐˜๐—ฎ๐—ฟ/๐˜„๐—ฎ๐˜๐—ฐ๐—ต this repository and get notified from ๐—š๐—ถ๐˜๐—›๐˜‚๐—ฏ
Stars: โœญ 60 (+252.94%)
Mutual labels:  reactive
stimulus reflex
Build reactive applications with the Rails tooling you already know and love.
Stars: โœญ 2,001 (+11670.59%)
Mutual labels:  reactive
fpEs
Functional Programming for EcmaScript(Javascript)
Stars: โœญ 40 (+135.29%)
Mutual labels:  reactive
urx
urx is a stream-based Reactive state management library
Stars: โœญ 18 (+5.88%)
Mutual labels:  reactive
Chat
A basic SwiftUI chat app that leverages the new URLSessionWebSocketTask.
Stars: โœญ 22 (+29.41%)
Mutual labels:  combine
FSRx
Parent repository to accompany session/workshop for Full Stack Reactive Java/Kotlin
Stars: โœญ 26 (+52.94%)
Mutual labels:  reactive

Bird

current version current version twitter handle Swift 5.0 compatible SPM Support license

๐Ÿค Bird ฮฑ

Bird is currently in alpha stage and should therefore not yet be used in a production environment.

Bird is a lightweight HTTP networking library written in Swift.
It is based on Apples new Reactive Framework Combine and focused on maintain- and extendability.

How to

Step 0: Install ๐Ÿค

If the first version is ready,
Bird will be available via SPM.

dependencies: [
    .package(url: "https://github.com/SebastianBoldt/Bird", from: "0.0.1"),
]

Step 1: Create a Request โš™๏ธ

The first thing you need to create is an Object that conforms to the RequestDefinition-Protocol.
This can be a struct, enum or class. It will provide all relevant values for making an actual HTTP-request.
In this Example we create a RequestDefinition
for an Endpoint of the PokeAPI that returns a Pokemon by its Pokdex-Number:

struct GetPokemon: RequestDefinition {
    let pokedexNumber: Int
    
    init(pokedexNumber: Int) {
        self.pokedexNumber = pokedexNumber
    }
}

extension GetPokemon {
    var method: HTTPMethod {
        return .get
    }

    var url: String {
        return "pokeapi.co"
    }

    var path: String {
        return "/api/v2/pokemon/\(pokedexNumber)"
    }
}

Step 2: Create a Model ๐Ÿ‘ฉ

Create the expected Model that will be returned by the Server.
It has to be Codable.

struct Pokemon: Codable {
    var name: String?
}

Step 3: Create a RequestService ๐Ÿฆ

After the Model was declared you need to create an Instance of Type: RequestService
You can do that by calling a static function on the class Bird.

let requestService = Bird.makeRequestService()

Step 4: Make a Request ๐Ÿฆ…

Because Bird is using Combine you will be familiar with the semantics.
Just sink & go to receive the response you requested.

let defition = GetPokemon(pokedexNumber: 3)
let request = try! requestService.request(defintion, responseType: Pokemon.self)
subscription = request.receive(on: RunLoop.main).sink(receiveCompletion: { completion in
    switch completion {
        case .finished:
            // Handle Finished Subscription
        case .failure(let error):
            // Handle Failure
    }
}, receiveValue: { pokemon in
    // Handle Success
})

Plugins โšก๏ธ

Plugins can be used e.g. to prepare requests or log responses.
A Plugin will be notified by 3 different function calls.

  • prepare
  • willSend
  • didReceive
struct ExamplePlugin: Plugin {
    func prepare(request: URLRequest, definition: RequestDefinition) -> URLRequest {
        // Manipulate the request with Authorization Headers etc. 
        return request
    }
    
    func willSend(request: URLRequest, definition: RequestDefinition) {
        // Request will be send in the next Step
    }
    
    func didReceive(result: URLSession.DataTaskPublisher.Output, definition: RequestDefinition) {
        // Request was successfull and will be published to the subscriber
    }
}

Planned Features ๐Ÿ•˜

  • Stubbing
  • PublisherPlugins
  • nested URL Parameters
  • Plugin-Suite

Author

Sebastian Boldt, https://www.sebastianboldt.com

I am a mobile software architect and developer specializing in iOS. Passionate about creating awesome user experiences, designing beautiful user interfaces, and writing maintainable, structured, and best-practice orientated code. Continuously trying to improve skills and learn new technologies.

current version

License

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

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].