Swiftpack.co - AlexLittlejohn/Ducks as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by AlexLittlejohn.
AlexLittlejohn/Ducks 2.0.0
A micro Redux implementation with a tiny bit of Combine sugar
⭐️ 6
🕓 2 years ago
iOS macOS watchOS tvOS
.package(url: "https://github.com/AlexLittlejohn/Ducks.git", from: "2.0.0")

header


GitHub Workflow Status License MIT Swift 5.5 codecov

Overview

Ducks is a micro Redux implementation that borrows "a lot" of inspiration from the Composable Architecture. However, it is designed to be much simpler and a more barebones offering.

Installation

Ducks supports installation through SPM on iOS 13, macOS 10.15, tvOS & watchOS.

Simply add Ducks to your package manifest.

dependencies: [
    .package(url: "https://github.com/alexLittlejohn/ducks.git", from: "1.0.0")
]

Examples

Check the Examples directory for the example app which will showcase how to use the framework as well as how to write tests for your features that use this library.

GitHub

link
Stars: 6
Last commit: 2 years ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

Release Notes

2.0.0
2 years ago

A major release with a complete overhaul of the Redux pattern.

Idiomatic Redux pattern

Old Pattern

New reducer to Effect pattern

New Pattern

  • In this context an Effect is essentially a Combine stream i.e. AnyPublisher<A, Never>.

Changes

  • Removed Middleware requirement
  • Introduced an Environment object to encapsulate dependencies for side effects
  • New Reducer function signature: typealias Reducer<A, S: Equatable, E> = (A, inout S, E) -> AnyPublisher<A, Never>
  • Added a statePublisher property which mirrors the @Published state property.

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics