Latest 0.1.6
Homepage https://github.com/briansemiglia/RxCacheMap
License MIT
Platforms ios 8.0, osx 10.9
Dependencies RxSwift
Authors

CI Status
Version
License
Platform

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Usage

queries.cacheMap { x -> URL? in
    // Closure executed once per unique `x`, replayed when not unique
    URL(string: "http://..." + x)
}

queries.cacheFlatMap { x -> Observable<JSON> in
    // Returned observable executed once per unique `x`, replayed when not unique
    NetworkRequest( ... + x).map { /* parse data */ }
}

queries.cacheFlatMapLatest { x -> Observable<JSON> in
    // Returned observable executed once per unique `x`, replayed when not unique
    // Any in-flight plays/replays are canceled by subsequent inputs
    NetworkRequest( ... + x).map { /* parse data */ }
}

queries.cacheFlatMapUntilExpired { x -> Observable<(JSON, Date)> in
    // Returned observable executed once per unique `x`, replayed when not unique until date output by returned observable is greater than or equal to date of subsequent replays
    NetworkRequest( ... + $0).map { response in 
        return (response.JSON, response.expirationDate)
    }
}

Installation

RxCacheMap is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod 'RxCacheMap'

Author

[email protected]

License

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

Latest podspec

{
    "name": "RxCacheMap",
    "version": "0.1.6",
    "summary": "A collection of caching RxSwift operators.",
    "description": "Cache the output of rx observables using cacheMap, cacheFlatMap, cacheFlatMapLatest and cacheFlatMapUntilExpired.",
    "homepage": "https://github.com/briansemiglia/RxCacheMap",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Brian Semiglia": "[email protected]"
    },
    "source": {
        "git": "https://github.com/briansemiglia/RxCacheMap.git",
        "tag": "0.1.6"
    },
    "social_media_url": "https://twitter.com/brians_",
    "platforms": {
        "ios": "8.0",
        "osx": "10.9"
    },
    "source_files": "RxCacheMap/Classes/**/*",
    "swift_version": "4.2",
    "dependencies": {
        "RxSwift": [
            "~> 4.4.1"
        ]
    }
}

Pin It on Pinterest

Share This