Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mkj-is/elementaryeffectbuilder
Experimental, uni-directional and purely functional effect builder in Swift.
https://github.com/mkj-is/elementaryeffectbuilder
effects elm function-builder function-composition redux-sagas swift unidirectional-data-flow
Last synced: about 1 month ago
JSON representation
Experimental, uni-directional and purely functional effect builder in Swift.
- Host: GitHub
- URL: https://github.com/mkj-is/elementaryeffectbuilder
- Owner: mkj-is
- License: mit
- Created: 2019-11-03T22:52:57.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2021-07-14T08:19:55.000Z (over 3 years ago)
- Last Synced: 2024-03-14T19:18:06.161Z (10 months ago)
- Topics: effects, elm, function-builder, function-composition, redux-sagas, swift, unidirectional-data-flow
- Language: Swift
- Homepage:
- Size: 25.4 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# ElementaryEffectBuilder
[**Elementary**](https://github.com/mkj-is/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:
```swift
.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:
```swift
let appEffect: Effect = buildEffect {
createNetworkEffect()
createPersistenceEffect()
createUrlEffect()
}
```Also `take` functions for building effects are provided.
See the following example:```swift
func createUrlEffect(application: UIApplication = .shared) -> Effect {
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](https://github.com/mkj-is).
Project is licensed under [MIT license](LICENSE.txt).