Have ideas to improve npm?Join in the discussion! »

react-action-decorators
TypeScript icon, indicating that this package has built-in type declarations

0.0.4 • Public • Published

React Action Decorators

Remove menial event handling

Example

import React from 'react';
import { withTemplateHelpers } from 'react-action-decorators';
 
@withTemplateHelpers
export default class MyComponent extends Component {
    render() {
        const { mut } = this;
        const { text } = this.state;
 
        return (
            <div>
              <input value={text} onChange={mut('text')} />
            </div>
        );
    }
}

Demo: https://codesandbox.io/s/2067py0prn

Available Helpers

  • mut
  • toggle
  • pipe

Keywords

none

Install

npm i react-action-decorators

DownloadsWeekly Downloads

36

Version

0.0.4

License

MIT

Unpacked Size

9.95 kB

Total Files

16

Last publish

Collaborators

  • avatar