react-professional
v1.0.0
Published
Overrides React Component by event driven version.
Downloads
4
Readme
React Professional
Overrides React Component by event driven version.
Methods
- on(event, handler) - bind event
- once(event, handler) - bind event once
- off(event, handler) - unbind event
- emit(event, data) - emit event
Examples
import {Component} from 'react-professional';
class SomeComponent extends Component {
...
}
component.on('some_event', () => console.log('event happend'));
component.emit('some_event');
const component = new Component({
onClick: (data) => console.log('clicked', data)
});
component.emit('click', 42);