Simple, lightweight, modular components and utilities to help conjure your app architecture. Built with Kotlin coroutines to provide flexible asynchronous behavior.
Learn about magic's APIs in the Overivew
Magic is hosted on Maven Central, simply add the following line to your build.gradle.kts
implementation("com.terathought.enchant:magic:1.0.0-alpha06")
Also, add the utilities from the sample app (see below) to your project in order to observe ViewModels from Compose and SwiftUI clients.
Want to see what magic looks like in a real project? The project includes a sample KMM project alongside the library so simply building the project (or opening the sampleIosApp folder in Xcode) allows you to run the sample app. Here are the important source files that power the demo:
- SampleViewModel.kt - Demonstrates how to implement ViewModel states and StatusViewModel statuses
- MainActivity.java - Includes required Android utilities and a sample UI using
SampleViewModel
- iOSApp.swift - Includes required iOS utilities and a sample UI using
SampleViewModel