All Projects → inamiy → SwiftElm

inamiy / SwiftElm

Licence: MIT license
Reactive + Automaton + VTree in Swift, inspired by Elm.

Programming Languages

swift
15916 projects
objective c
16641 projects - #2 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to SwiftElm

Omi
Front End Cross-Frameworks Framework - 前端跨框架跨平台框架
Stars: ✭ 12,153 (+12428.87%)
Mutual labels:  virtual-dom
Preact Worker Demo
Demo of preact rendering an entire app in a Web Worker.
Stars: ✭ 204 (+110.31%)
Mutual labels:  virtual-dom
Gccx
Transforms CPX (JSX like syntax) into asm-dom Virtual DOM
Stars: ✭ 234 (+141.24%)
Mutual labels:  virtual-dom
Amplesdk
Ample SDK - JavaScript UI Framework
Stars: ✭ 169 (+74.23%)
Mutual labels:  virtual-dom
Virtual Dom
The foundation of HTML and SVG in Elm.
Stars: ✭ 196 (+102.06%)
Mutual labels:  virtual-dom
Hydux
A light-weight type-safe Elm-like alternative for Redux ecosystem, inspired by hyperapp and Elmish
Stars: ✭ 216 (+122.68%)
Mutual labels:  virtual-dom
Miso
🍜 A tasty Haskell front-end framework
Stars: ✭ 1,911 (+1870.1%)
Mutual labels:  virtual-dom
Live
Live views and components for golang
Stars: ✭ 251 (+158.76%)
Mutual labels:  virtual-dom
Svg Patterns
SVG patterns for Data Visualization.
Stars: ✭ 201 (+107.22%)
Mutual labels:  virtual-dom
Respo
A virtual DOM library built with ClojureScript, inspired by React and Reagent.
Stars: ✭ 230 (+137.11%)
Mutual labels:  virtual-dom
Val
VirtualDOM abstraction layer - give yourself better integration and full control over the DOM with any virtual DOM library that uses a Hyperscript-like API such as React and Preact.
Stars: ✭ 181 (+86.6%)
Mutual labels:  virtual-dom
Mithril.js
A JavaScript Framework for Building Brilliant Applications
Stars: ✭ 13,062 (+13365.98%)
Mutual labels:  virtual-dom
Asm Dom
A minimal WebAssembly virtual DOM to build C++ SPA (Single page applications)
Stars: ✭ 2,604 (+2584.54%)
Mutual labels:  virtual-dom
Squark
Rust frontend framework, for web browser and more.
Stars: ✭ 162 (+67.01%)
Mutual labels:  virtual-dom
Superviews.js
Template engine targeting incremental-dom
Stars: ✭ 242 (+149.48%)
Mutual labels:  virtual-dom
Gantt
Gantt chart library using jsx support SVG, Canvas and SSR
Stars: ✭ 148 (+52.58%)
Mutual labels:  virtual-dom
Panel
Web Components + Virtual DOM: web standards for powerful UIs
Stars: ✭ 206 (+112.37%)
Mutual labels:  virtual-dom
xstate-react-router
XState connector to React Router.
Stars: ✭ 23 (-76.29%)
Mutual labels:  state-machine
Ng Vdom
(Developer Preview) A virtual-DOM extension for Angular, also work as React bridge.
Stars: ✭ 249 (+156.7%)
Mutual labels:  virtual-dom
Ioing
Implement the solutions of performance improvement and componentization for your SPA (single page application) products with this Progressive Web App Development Engine.
Stars: ✭ 224 (+130.93%)
Mutual labels:  virtual-dom

SwiftElm

Reactive + Automaton + VTree in Swift, inspired by Elm.

Note: This library is only a 100 lines of code.

Example

// main.swift

import UIKit
import VTree
import SwiftElm

enum Msg: AutoMessage {
    case increment
    case decrement
}

typealias Model = Int

func update(state: Model, input: Msg) -> Model? {
    switch input {
        case .increment:
            return state + 1
        case .decrement:
            return state - 1
    }
}

func view(_ model: Model) -> VView<Msg> {
    return VView(children: [
        *VLabel(text: "\(model)"),
        *VButton(title: "+", handlers: [.touchUpInside : .increment]),
        *VButton(title: "-", handlers: [.touchUpInside : .decrement]),
    ])
}

// App main entrypoint (using `UIApplicationMain`).
appMain {
    return Program(model: 0, update: update, view: view)
}

Please see Demo Projects for more information.

Metaprogramming with Sourcery

SwiftElm uses Sourcery as Swift template metaprogramming engine to cover transcripting that elm-lang/core does when converting enum MyMsg to JavaScript.

Please see VTree/README.md for more information.

Acknowledgement

  • Evan Czaplicki: Creator of Elm

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].