https://github.com/harshdoesdev/supa-app
A Supa Small Reactive View Library
https://github.com/harshdoesdev/supa-app
Last synced: 3 months ago
JSON representation
A Supa Small Reactive View Library
- Host: GitHub
- URL: https://github.com/harshdoesdev/supa-app
- Owner: harshdoesdev
- License: mit
- Created: 2022-07-05T13:47:34.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2022-07-20T09:06:18.000Z (almost 3 years ago)
- Last Synced: 2023-07-09T14:32:34.593Z (almost 2 years ago)
- Language: JavaScript
- Size: 50.8 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# supa-app
A Supa Small Reactive View Library## Install
```bash
npm i supa-app
```# Counter App Demo
```javascript
import { h, text, runApp } from 'supa-app';const IncrementBy = amt => state => ({
...state, count: state.count + amt
});runApp({
node: document.getElementById('app'),
state: {
count: 0
},
effects: state => [],
subscriptions: state => [],
view: (state, setState) => {
return (
h('main', {},
h('output', {},
text('Counter: '), text(state.count)
),
h('div', {},
h('button', { onclick: () => setState(IncrementBy(1)) }, text('+')),
h('button', { onclick: () => setState(IncrementBy(-1)) }, text('-'))
)
)
)
}
});
```