Skip to content
This repository has been archived by the owner on May 22, 2021. It is now read-only.

Releases: 0xLet/Combino

Combino++

04 Dec 01:39
321e112
Compare
Choose a tag to compare

Named Tuple Values

Future<(data: Data?, response: URLResponse?), Error>

Exported import Combine

@_exported import Combine

Combino+

11 Sep 00:36
Compare
Choose a tag to compare

promise

promise<T>(work: @escaping (@escaping Future<T, Error>.Promise) -> Void) -> Future<T, Error>

promise(work: @escaping (@escaping Future<Void, Error>.Promise) -> Void) -> Future<Void, Error>

do

do<T>(withDelay delay: UInt32 = 0,
                               work: @escaping () throws -> T) -> Future<T, Error>

do(withDelay delay: UInt32 = 0,
                            work: @escaping () throws -> Void = {}) -> Future<Void, Error>

main

main<T>(withDelay delay: UInt32 = 0,
                               work: @escaping () throws -> T) -> Future<T, Error>

main(withDelay delay: UInt32 = 0,
                            work: @escaping () throws -> Void = {}) -> Future<Void, Error>

fetch

fetch(url: URLRequest) -> Future<(Data?, URLResponse?), Error>

fetch(url: URL) -> Future<(Data?, URLResponse?), Error>

post

post(request: URLRequest) -> Future<(Data?, URLResponse?), Error>

post(url: URL, withData data: (() -> Data)? = nil) -> Future<(Data?, URLResponse?), Error>

Combino Examples

.sink(SinkEvent)

Combino
    .do(withDelay: 5)
    .sink(.success { someFunction() })
    .store(in: &bag)

.sink(() -> [SinkEvents])

Combino
    .do(withDelay: 5) {
        "Hello World!"
}
.sink {
    [
        .completion {
            sema.signal()
        },
        .success { value in
            XCTAssertEqual(value, "Hello World!")
        },
        .failure { _ in
            XCTAssert(false)
        }
    ]
}
.store(in: &bag)

Combino

10 Sep 23:23
Compare
Choose a tag to compare

promise

promise<T>(work: @escaping (@escaping Future<T, Error>.Promise) -> Void) -> Future<T, Error>

promise(work: @escaping (@escaping Future<Void, Error>.Promise) -> Void) -> Future<Void, Error>

do

do<T>(withDelay delay: UInt32 = 0,
                               work: @escaping () throws -> T) -> Future<T, Error>

do(withDelay delay: UInt32 = 0,
                            work: @escaping () throws -> Void = {}) -> Future<Void, Error>

main

main<T>(withDelay delay: UInt32 = 0,
                               work: @escaping () throws -> T) -> Future<T, Error>

main(withDelay delay: UInt32 = 0,
                            work: @escaping () throws -> Void = {}) -> Future<Void, Error>

fetch

fetch(url: URLRequest) -> Future<(Data?, URLResponse?), Error>

fetch(url: URL) -> Future<(Data?, URLResponse?), Error>

post

post(request: URLRequest) -> Future<(Data?, URLResponse?), Error>

post(url: URL, withData data: (() -> Data)? = nil) -> Future<(Data?, URLResponse?), Error>

Combino Examples

.sink(SinkEvent)

Combino
    .do(withDelay: 5)
    .sink(.success { someFunction() })
    .store(in: &bag)

.sink(() -> [SinkEvents])

Combino
    .do(withDelay: 5) {
        "Hello World!"
}
.sink {
    [
        .completion {
            sema.signal()
        },
        .success { value in
            XCTAssertEqual(value, "Hello World!")
        },
        .failure { _ in
            XCTAssert(false)
        }
    ]
}
.store(in: &bag)