put-stuff-on-website
v1.1.1
Published
**PLEASE DO NOT USE THIS**
Downloads
6
Readme
Put Stuff On Website
PLEASE DO NOT USE THIS
a shitty javascript ui framework
Use (but please do not)
link directly to umd build -
https://unpkg.com/[email protected]
or
npm i put-stuff-on-website --save
(but don't do this)
Example
import { createStore, render } from "put-stuff-on-website";
const initialState = {
whatShouldIdoWithThis: "probably not use it"
};
function updater(state, { type, payload }) {
let newState = Object.assign({}, state);
switch(type) {
case "PLEASE_DO_NOT_USE_THIS": {
newState.busLine = payload;
break;
}
default: {
newState = state;
}
}
return newState;
}
const store = createStore({ updater, state: initialState });
function App({ whatShouldIDoWithThis }) {
return {
tagName: "div",
props: {
className: "my-div",
onclick: () => store.dispatch({ type: "PLEASE_DO_NOT_USE_THIS", payload: "i said please"})
},
children: [
{
tagName: "span",
children: whatShouldIDoWithThis
}
]
};
store.subscribe(state => render(App({ whatShouldIDoWith: initialState.whatShouldIDoWithThis }), #root));
render(App({ whatShouldIDoWith: initialState.whatShouldIDoWithThis }), #root);
}