<commit_before>var TweenMax = require('gsap')

module.exports = function(Promise) {
	function animateFunc(func, element, duration, opts) {
		opts = opts||{}
		return new Promise(function(resolve, reject) {
			opts.onComplete = resolve
			func(element, duration, opts)
		})
	}

	var animateTo = animateFunc.bind(null, TweenMax.to)

	var util = animateTo
	util.to = animateTo
	util.from = animateFunc.bind(null, TweenMax.from)
	
	util.set = function animateSet(element, params) {
		params = params||{}
		return new Promise(function(resolve, reject) {
			params.onComplete = resolve
			TweenMax.set(element, params)
		})
	}

	util.fromTo = function animateFromTo(element, duration, from, to) {
		to = to||{}
		return new Promise(function(resolve, reject) {
			to.onComplete = resolve
			TweenMax.fromTo(element, duration, from, to)
		})
	}
	return util	
}<commit_msg>adding "all" for convenience<commit_after>var TweenMax = require('gsap')

module.exports = function(Promise) {
	function animateFunc(func, element, duration, opts) {
		opts = opts||{}
		return new Promise(function(resolve, reject) {
			opts.onComplete = resolve
			func(element, duration, opts)
		})
	}

	var animateTo = animateFunc.bind(null, TweenMax.to)

	var util = animateTo
	util.to = animateTo
	util.from = animateFunc.bind(null, TweenMax.from)
	
	util.set = function animateSet(element, params) {
		params = params||{}
		return new Promise(function(resolve, reject) {
			params.onComplete = resolve
			TweenMax.set(element, params)
		})
	}

	util.fromTo = function animateFromTo(element, duration, from, to) {
		to = to||{}
		return new Promise(function(resolve, reject) {
			to.onComplete = resolve
			TweenMax.fromTo(element, duration, from, to)
		})
	}

	util.all = Promise.all
	return util	
}
{'fraction_non_alphanumeric': 0.126131221719457, 'fraction_numerical': 0.0, 'mean_word_length': 4.280597014925373, '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': '5534589', 'n_tokens_mistral': 646, 'n_tokens_neox': 575, 'n_words': 139}