commit 195181089d748c83957b521734ed0cdde1d76c2a parent 0803ef251edff24cbce994cbd61f0fd0569399c2 Author: Massimo Siboldi <mdsiboldi@gmail.com> Date: Tue, 20 Mar 2018 13:31:25 -0700 include important file for high def canvases Diffstat:
A | src/UpdateOnResize/index.js | | | 16 | ++++++++++++++++ |
1 file changed, 16 insertions(+), 0 deletions(-)
diff --git a/src/UpdateOnResize/index.js b/src/UpdateOnResize/index.js @@ -0,0 +1,16 @@ +import { h, Component } from 'preact'; + +export default class UpdateOnResize extends Component { + doIt = () => { + this.props.action(); + } + componentDidMount() { + window.addEventListener('resize', this.doIt); + } + componentWillUnmount() { + window.removeEventListener('resize', this.DoIt); + } + render() { + return <span>{this.props.children}</span>; + } +}