Skip to content

grenos/zustand-ios

Repository files navigation

Zustand-SwiftUI (Work in progress)

A simple test project that recreates Zustand–style state management for SwiftUI, powered by Boutique.


Overview

This repository demonstrates how to build a lightweight, composable state store in SwiftUI—similar in spirit to JavaScript’s Zustand library. It uses Boutique under the hood to provide:

  • Global, shared state that SwiftUI views can read from and write to.
  • Simple API: subscribe to slices of state, update via closures.
  • No boilerplate: no generated code, no macros, just plain Swift.

⚠️ Note: This is purely an experimental “proof of concept” and not production-ready. Use at your own risk!


Features

  • 🔄 Reactive bindings: SwiftUI views automatically refresh when the slice of state they depend on changes.
  • đź§© Composable stores: Combine multiple state slices into one centralized store.
  • 🚀 Minimal API: Inspired by Zustand’s API style.
  • đź”— Boutique-powered: Leverages the Boutique package for state container management.

Getting Started

Requirements

  • Xcode 14.0 or later
  • iOS 15.0+, macOS 12.0+
  • Swift 5.7+

Installation

  1. Clone the repo
    git clone https://github.com/your-username/Zustand-SwiftUI.git
    cd Zustand-SwiftUI

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages