This app provides monitoring and information features for the common freifunk user and the technical stuff of a freifunk community. Code base is taken from a TUM Practical Course project and added here to see if Freifunk Altdorf can use it. https://www.freifunk-altdorf.de
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
Bernhard Blieninger fc05486403 initial commit taken from gitlab.lrz.de 6 years ago
..
__tests__ initial commit taken from gitlab.lrz.de 6 years ago
.eslintignore initial commit taken from gitlab.lrz.de 6 years ago
.eslintrc initial commit taken from gitlab.lrz.de 6 years ago
.travis.yml initial commit taken from gitlab.lrz.de 6 years ago
CONTRIBUTING.md initial commit taken from gitlab.lrz.de 6 years ago
LICENSE initial commit taken from gitlab.lrz.de 6 years ago
README.md initial commit taken from gitlab.lrz.de 6 years ago
TimerMixin.js initial commit taken from gitlab.lrz.de 6 years ago
package.json initial commit taken from gitlab.lrz.de 6 years ago

README.md

react-timer-mixin

Using bare setTimeout, setInterval, setImmediate and requestAnimationFrame calls is very dangerous because if you forget to cancel the request before the component is unmounted, you risk the callback throwing an exception.

If you include TimerMixin, then you can replace your calls to setTimeout(fn, 500) with this.setTimeout(fn, 500) (just prepend this.) and everything will be properly cleaned up for you.

Installation

Install the module directly from npm:

npm install react-timer-mixin

Example

var React = require('react');
var TimerMixin = require('react-timer-mixin');

var Component = React.createClass({
  mixins: [TimerMixin],
  componentDidMount() {
    this.setTimeout(
      () => { console.log('I do not leak!'); },
      500
    );
  }
});