import { h, app } from "hyperapp";
// State init
const initialState = {
counter: 0,
text: "yo!"
};
const ResetState = () => {
return {
...initialState
};
};
// Action example
const Increment = state => {
return {
...state,
counter: ++state.counter
};
};
// Component example
const LineSpace = () => h("div", { class: "line-space" });
// hyperapp init
app({
init: { ...initialState },
view: state => {
return h("div", {}, [
h("p", {}, `Now is ${state.counter}`),
LineSpace(),
h("button", { onClick: Increment }, "+"),
h("p", {}, ` text: ${state.text}`),
LineSpace(),
h("button", { onClick: ResetState }, "Reset")
]);
},
node: document.getElementById("app")
});
Security - the elephant in the room. Everyone agrees that it is very important but few takes it seriously. We at RisingStack want you to do it right - this is why we have put together this checklist to help you guide through the must have security checks before your application is enabled to thousands of users/customers.
NPM Packages:
Refactoring.Guru makes it easy for you to discover everything you need to know about refactoring, design patterns, SOLID principles, and other smart programming topics.