<commit_before>var xtend = require('xtend')
var eases = require('eases')
var Ticker = require('tween-ticker')
var EventEmitter = require('events').EventEmitter;
var inherits = require('inherits')
var mixin = require('mixes')
var loop = require('./loop')

var defaultOpt = { eases: eases }

module.exports = Tweenr
function Tweenr(opt) {
    if (!(this instanceof Tweenr))
        return new Tweenr(opt)

    Ticker.call(this, xtend(defaultOpt, opt))
    EventEmitter.call(this)

    this._handleTick = function(dt) {
        dt /= 1000
        this.emit('tick', dt)
        this.tick(dt)
    }.bind(this)

    loop.on('tick', this._handleTick)
}

inherits(Tweenr, Ticker)
mixin(Tweenr, EventEmitter.prototype)

Tweenr.prototype.dispose = function() {
    loop.removeListener('tick', this._handleTick)
}<commit_msg>capping delta time to 30 ms<commit_after>var xtend = require('xtend')
var eases = require('eases')
var Ticker = require('tween-ticker')
var EventEmitter = require('events').EventEmitter;
var inherits = require('inherits')
var mixin = require('mixes')
var loop = require('./loop')

var defaultOpt = { eases: eases }

module.exports = Tweenr
function Tweenr(opt) {
    if (!(this instanceof Tweenr))
        return new Tweenr(opt)

    Ticker.call(this, xtend(defaultOpt, opt))
    EventEmitter.call(this)

    this._handleTick = function(dt) {
        dt = Math.min(30, dt) //cap delta at 30 ms
        dt /= 1000
        this.emit('tick', dt)
        this.tick(dt)
    }.bind(this)

    loop.on('tick', this._handleTick)
}

inherits(Tweenr, Ticker)
mixin(Tweenr, EventEmitter.prototype)

Tweenr.prototype.dispose = function() {
    loop.removeListener('tick', this._handleTick)
}
{'fraction_non_alphanumeric': 0.14353219137625517, 'fraction_numerical': 0.008269344359125812, 'mean_word_length': 3.84, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5656488', 'n_tokens_mistral': 590, 'n_tokens_neox': 575, 'n_words': 129}