mirror of
https://github.com/twisterarmy/twister-react.git
synced 2025-01-13 08:27:57 +00:00
12 lines
302 B
JavaScript
Executable File
12 lines
302 B
JavaScript
Executable File
module.exports = EventListenerMixin = function (eventtype) {
|
|
|
|
return {
|
|
componentDidMount: function() {
|
|
window.addEventListener(eventtype, this["on"+eventtype]);
|
|
},
|
|
componentWillUnmount: function() {
|
|
window.removeEventListener(eventtype, this["on"+eventtype]);
|
|
}
|
|
}
|
|
|
|
} |