hyperapp-extended
v1.1.7
Published
Hyperapp extended
Downloads
4
Readme
Hyperapp
Hyperapp is a JavaScript library for building web applications.
What's different
hyperapp-extended
is hyperapp
, but with a few additions.
Actions
Actions have an additional parameter.
// hyperapp
const actions = {
example: value => (state, actions) => { /* state changes */ },
};
// hyperapp-extended
const actions = {
example: value => (state, actions, current) => { /* state changes */ },
}
Components
Components have an additional parameter.
// hyperapp
const Component = (attributes, children) => <div />;
// hyperapp-extended
const Component = (attributes, children, current) => <div />;
What is 'current'?
current
is an object with two methods:
getState()
- returns the current app's global stategetActions()
- returns the current app's global actions