Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/k1r0s/superpie

minimal dom lib based on superfine
https://github.com/k1r0s/superpie

frontend hyperapp state-management superfine virtual-dom web-components

Last synced: 10 days ago
JSON representation

minimal dom lib based on superfine

Awesome Lists containing this project

README

        

### SUPERPIE for superfine v6

[As superfine updates to v7 several unreconcilable changes push superpie to 6.*](https://github.com/jorgebucaran/superfine/issues/167)

> this readme is not completed yet

Lightweight library based on [superfine](https://github.com/jorgebucaran/superfine).

##### Why?

Superfine is tiny vdom library used to build web interfaces. It comes with the minimum features to provide flexibility and simplicity. But when facing any serious development you need at least to add several features such as state management and styling.

This library size is only 717 Bytes and is the perfect complement to superfine if you want to quickly develop simple and blazing fast web apps.

##### Samples

- [Form](/demo/form) - Form management and state binding as a component.
- [Router](/demo/router) - HTML5 history API management as a component.
- [Select](/demo/select) - Native `` tag with filter and scoped styles.

##### What does it include?

- scoped state

```jsx
import { h } from 'superfine';
import { statefine } from "superpie";

const Counter = statefine(({ state, setState }) => (

setState({ amount: 0 })}>


{state.amount}
setState(prev => ({ amount: prev.amount + 1 }))}>+



))

```

- scoped css

```jsx
import { h } from 'superfine';
import { stylefine } from "superpie";

const FancyButton = stylefine(
`
button {
cursor: pointer;
border-style: none;
padding: .5rem;
margin: 0 .5rem .5rem 0;
}

`,
({ children, ...props }) => (
{children}
)
)
```

- cheap classy syntax

```jsx
import { h } from 'superfine';
import { cyclefine } from "superpie";

const DisplayMessage = cyclefine({
// this is a superfine component hook
oncreate() {
SomeService.fetch().then(res =>
this.setState({ message: res.message }));
},
onrender() {
const message = this.state && this.state.message
return (


{message}

)
}
})

```