Skip to content

2.0.0

Latest
Compare
Choose a tag to compare
@AlexLittlejohn AlexLittlejohn released this 02 Feb 17:11

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.