npm

Join us for the "JavaScript Supply Chain Security" tech talk, presented by VP of Security, Adam Baldwin. 6/20 at 10am PT.Sign up here »

pop

0.0.33 • Public • Published

Pop

Pop is a Hyperapp / Ultradom spin-off project — yet another micro-framework for creating graphical user interfaces. This is not the final title, but let's go with that for now.


With Pop I intend to improve the pain points I've experienced with Hyperapp due to its pragmatic attitude towards application building. The tradeoff is that Pop will be less flexible, making it very difficult to produce side-effects.

Pop's core value proposition is the eradication of the "wired" actions concept, making it extremely easy to load new functionaly into your application dynamically and reducing the boilerplate necessary to assemble your state from different modules, passing props through the component tree, etc.

Install

npm i pop

Usage

import Pop, { Time } from "pop"
 
const decrement = state => ({
  count: state.count - 1
})
 
const increment = number => state => ({
  count: state.count + number
})
 
const double = state => ({
  count: state.count - 1
})
 
document.body.appendChild(
  Pop.create({ count: 0 }, state => (
    <Main>
      <div>
        <h1>{state.count}</h1>
        <button onclick={decrement}>Increment</button>
        <button onclick={increment(1)}>Decrement</button>
        <button onclick={double}>Decrement</button>
      </div>
 
      <Time every={1000} ontick={increment(1)} />
    </Main>
  ))
)

License

Pop is MIT licensed. See LICENSE.

Keywords

install

npm i pop

Downloadsweekly downloads

52

version

0.0.33

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability