action-class
v1.0.0
Published
You probably shouldn't use this, this is just a personal development tool that I'll probably ditch very soon
Downloads
6
Readme
action-class
You probably shouldn't use this, this is just a personal development tool that I'll probably ditch very soon
the gist
Create actions in a readable way by using the new
keyword,
actions are intended to be immutable objects, instantiating
an action inside of an argument expression clearly conveys
this intention (given one knows the dispatcher will never
modify an action)
Works especially well with entity classes!
store.dispatch(new CreateTodoItemAction(new TodoItem({name: ''})));
Example inside of a react component
MyComponent = () => {
return (
<button onClick={}>
);
}
render(
<MyComponent />
);