All Projects → fwilkerson → Muve

fwilkerson / Muve

Licence: mit
Muve is a micro library for building interactive javascript applications.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Muve

Preact
⚛️ Fast 3kB React alternative with the same modern API. Components & Virtual DOM.
Stars: ✭ 30,527 (+277418.18%)
Mutual labels:  virtual-dom, vdom, jsx
Ng Vdom
(Developer Preview) A virtual-DOM extension for Angular, also work as React bridge.
Stars: ✭ 249 (+2163.64%)
Mutual labels:  virtual-dom, vdom, jsx
Wonders
🌈 Declarative JavaScript framework to build command-line applications.
Stars: ✭ 34 (+209.09%)
Mutual labels:  virtual-dom, vdom, jsx
Vhtml
Render JSX/Hyperscript to HTML strings, without VDOM 🌈
Stars: ✭ 556 (+4954.55%)
Mutual labels:  virtual-dom, vdom, jsx
Omi
Front End Cross-Frameworks Framework - 前端跨框架跨平台框架
Stars: ✭ 12,153 (+110381.82%)
Mutual labels:  virtual-dom, vdom, jsx
joltik
A really small VDOM library
Stars: ✭ 40 (+263.64%)
Mutual labels:  jsx, vdom
vdom
Simple JavaScript Virtual DOM
Stars: ✭ 17 (+54.55%)
Mutual labels:  virtual-dom, vdom
Htm
Hyperscript Tagged Markup: JSX alternative using standard tagged templates, with compiler support.
Stars: ✭ 7,299 (+66254.55%)
Mutual labels:  virtual-dom, jsx
Refractor
Lightweight, robust, elegant virtual syntax highlighting using Prism
Stars: ✭ 291 (+2545.45%)
Mutual labels:  virtual-dom, vdom
Gccx
Transforms CPX (JSX like syntax) into asm-dom Virtual DOM
Stars: ✭ 234 (+2027.27%)
Mutual labels:  virtual-dom, jsx
react-lite
A simple implementation of react
Stars: ✭ 51 (+363.64%)
Mutual labels:  virtual-dom, jsx
Lowlight
Virtual syntax highlighting for virtual DOMs and non-HTML things
Stars: ✭ 310 (+2718.18%)
Mutual labels:  virtual-dom, vdom
tung
A javascript library for rendering html
Stars: ✭ 29 (+163.64%)
Mutual labels:  virtual-dom, jsx
core
Server side rendering with The Elm Architecture in Deno
Stars: ✭ 16 (+45.45%)
Mutual labels:  virtual-dom, jsx
Puddles
Tiny vdom app framework. Pure Redux. No boilerplate.
Stars: ✭ 24 (+118.18%)
Mutual labels:  virtual-dom, vdom
zaftig
~2kB css in js: z`display flex` // .zjsdkk43-1
Stars: ✭ 15 (+36.36%)
Mutual labels:  jsx, vdom
Ivi
🔥 Javascript (TypeScript) library for building web user interfaces
Stars: ✭ 445 (+3945.45%)
Mutual labels:  virtual-dom, vdom
Hyperawesome
A curated list of awesome projects built with Hyperapp & more.
Stars: ✭ 446 (+3954.55%)
Mutual labels:  vdom, jsx
Nerv
A blazing fast React alternative, compatible with IE8 and React 16.
Stars: ✭ 5,409 (+49072.73%)
Mutual labels:  vdom, jsx
Mithril.js
A JavaScript Framework for Building Brilliant Applications
Stars: ✭ 13,062 (+118645.45%)
Mutual labels:  virtual-dom, vdom

Muve

Muve is a micro library for building interactive javascript applications. Muve is built around a basic concept, changes to the model update the view. There are three parts to an application built with Muve; A model to represent the state of your application, functions that serve as an api for updating your model, and a view to describe that model.


Libraries

muve-router


Demos

A progressive web app that features routing, code-splitting, and gives an idea of how to structure larger apps.

muve-forward


Quick Start

npm i --save muve   or   yarn add muve

import muve, {h, interact} from 'muve';

// The model
const model = {counter: 0};

// interact creates helpers for checking & changing the model.
const {getModel, setModel} = interact(model);

function updateCounter(value) {
	const {counter} = getModel();

	// Validate that the count can be changed
	if (value < 0 && counter < 1) return;

	// update the model with the new counter
	setModel({counter: counter + value});
}

// The view function represents the model
function view(model) {
	return <h2>{model.counter}</h2>;
}

// Finally give the view, model, and target element to muve
muve(view, model, document.getElementById('root'));

// for simplicity we will update the counter every second
setInterval(() => updateCounter(1), 1000);

For more in depth examples be sure to look at the demos.


API

In an attempt to keep things simple, muve exposes only three functions one of which is to enable the use of jsx.

muve(view, init, target, hydrate)

Initializes a muve application, this performs some setup and does the initial render of the view.

Parameters

Name Type Description
view Function The entry point of your application
init Object The initial model of your application
target HTMLElement The element muve should attach itself to
hydrate Boolean Set to true if the page was server rendered

Returns

  • Void

h(type, attributes, children)

Used to convert jsx to js objects. Import this function in any file where you wish to use jsx.


interact(model, log?)

Given your initial model, interact returns two functions for interacting with your model.

Parameters

Name Type Description
model Object The initial model of your application
log Function? Executed each time setModel is called with a name

Returns

  • Object
    • getModel
    • setModel

getModel()

Returns the current model.

Returns

  • Object

setModel(update, name?)

When executed the update will be applied to your application's model, your view function will be executed, and the DOM will be patched.

Parameters

Name Type Description
update Object A part of your model you wish to change
name String? Name your updates to have them logged

Returns

  • Void
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].