spheres

0.20.0 • Public • Published

Spheres

Write browser-based web applications. Spheres features:

  • state management that separates application logic from state storage details
  • a declarative view framework that supports fine-grained reactive updates

Check out the documentation.

Here's a simple counter app:

import { renderToDOM } from "spheres/view";
import { container, update, createStore } from "spheres/store";

const clickCount = container({ initialValue: 0 })

function counter (root: HTMLBuilder) {
  root.main(el => {
    el.children
      .p(el => {
        el.config.dataAttribute("counter-text")
        el.children.textNode((get) => `Clicks: ${get(clickCount)}`)
      })
      .button(el => {
        el.config.on("click", () => update(clickCount, (count) => count + 1))
        el.children.textNode("Count!")
      })
  })
}

renderToDOM(createStore(), document.getElementById("app"), counter)

Find more examples here.

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
0.20.07latest

Version History

VersionDownloads (Last 7 Days)Published
0.20.07
0.19.35
0.19.24
0.19.13
0.19.03
0.18.03
0.17.12
0.17.01
0.16.02
0.15.50
0.15.40
0.15.30
0.15.20
0.15.12
0.15.01
0.14.21
0.14.10
0.14.00
0.13.10
0.13.01
0.12.01
0.11.10
0.11.00
0.10.00
0.9.11
0.9.00
0.8.01

Package Sidebar

Install

npm i spheres

Weekly Downloads

22

Version

0.20.0

License

MIT

Unpacked Size

965 kB

Total Files

153

Last publish

Collaborators

  • brian-watkins