目录
目录README.md

ElementaryEffectBuilder

Elementary uni-directional architecture extension in Swift. This package function builder for creating and combining effects. It is inspired by Redux sagas.

Installation

When using Swift package manager install using Xcode 11+ or add following line to your dependencies:

.package(url: "https://github.com/mkj-is/ElementaryEffectBuilder.git", from: "0.1.0")

Usage

Main feature of this package is combining effects function into one:

let appEffect: Effect<AppState, AppAction> = buildEffect {
    createNetworkEffect()
    createPersistenceEffect()
    createUrlEffect()
}

Also take functions for building effects are provided. See the following example:

func createUrlEffect(application: UIApplication = .shared) -> Effect<AppState, AppAction> {
    take(
        AppAction.openHomepage,
        execute: { application.open(URL(string: "https://mkj.is")!) }
    )
}

Contributing

All contributions are welcome.

Project was created by Matěj Kašpar Jirásek.

Project is licensed under MIT license.

关于
56.0 KB
邀请码
    Gitlink(确实开源)
  • 加入我们
  • 官网邮箱:gitlink@ccf.org.cn
  • QQ群
  • QQ群
  • 公众号
  • 公众号

©Copyright 2023 CCF 开源发展委员会
Powered by Trustie& IntelliDE 京ICP备13000930号