Skip to content

Releases: Khizanag/MVIKit

MVIKit 1.0.1

Choose a tag to compare

@Khizanag Khizanag released this 29 Sep 10:54

A bug-fix release. Upgrading is recommended for every app that uses MVIKit.

Fixed

  • A cancelled effect could still deliver one stale intent. Send checked for cancellation before hopping to the main actor. If the effect was cancelled between that check and the hop, the intent still reached the reducer. For example, a new keystroke arriving while a search response was being delivered could leave the old results on screen. The check now runs on the main actor, immediately before delivery, so an intent from a cancelled effect is always dropped.

A regression test in SendTests holds the main actor while the effect reaches send, cancels, and asserts the intent never lands. It fails on 1.0.0 and passes on 1.0.1.

No API changes.

.package(url: "https://github.com/Khizanag/MVIKit", from: "1.0.1")

MVIKit 1.0.0

Choose a tag to compare

@Khizanag Khizanag released this 29 Sep 06:17

The first standalone release of MVIKit: Model-View-Intent for SwiftUI in about 270 lines, with zero dependencies.

What's inside

  • Reducer: the pure state machine, (inout State, Intent) -> Effect<Intent>
  • Effect: async work as data, .run(id:_:), .cancel(_:), .merge(_:), with switch-latest cancellation by EffectID
  • Send: the only channel from an effect back into the loop. It drops intents after cancellation
  • Store: the @Observable loop driver, with binding(_:send:) and settle() for .refreshable and tests
  • LoadingPhase: idle, loading, loaded, failed with a typed failure

Requirements

  • Swift 6.2 or later (Xcode 26 or later)
  • iOS 17, macOS 14, tvOS 17, watchOS 10, visionOS 1

Installation

.package(url: "https://github.com/Khizanag/MVIKit", from: "1.0.0")

Extracted from Cinematic, the reference app built on it, with the full commit history kept.