transition updates

This commit is contained in:
Adam Bradley
2015-05-05 08:53:59 -05:00
parent 478b7b83c6
commit 0e754ada16
12 changed files with 353 additions and 182 deletions

View File

@ -1,4 +1,4 @@
export function noop() {}
export function noop() {};
export function clamp(min, n, max) {
return Math.max(min, Math.min(n, max));
@ -54,27 +54,27 @@ export const isArray = Array.isArray
export function pascalCaseToDashCase(str = '') {
return str.charAt(0).toLowerCase() + str.substring(1).replace(/[A-Z]/g, match => {
return '-' + match.toLowerCase()
})
return '-' + match.toLowerCase();
});
}
let uid = 0
let uid = 0;
export function nextUid() {
return ++uid;
}
export class Log {
static log(...args) {
console.log.apply(console, args)
console.log.apply(console, args);
}
static info(...args) {
console.info.apply(console, args)
console.info.apply(console, args);
}
static warn(...args) {
console.warn.apply(console, args)
console.warn.apply(console, args);
}
static error(...args) {
console.error.apply(console, args)
console.error.apply(console, args);
}
}
@ -85,12 +85,12 @@ export let array = {
}
},
remove(arr, item) {
const index = arr.indexOf(item)
const index = arr.indexOf(item);
if (index === -1) {
return false
return false;
}
arr.splice(index, 1)
return true
arr.splice(index, 1);
return true;
}
}
@ -101,8 +101,8 @@ export function getQuerystring(key) {
const queries = window.location.href.slice(startIndex + 1).split('&');
if (queries.length) {
queries.forEach((param) => {
var split = param.split('=')
queryParams[split[0]] = split[1]
var split = param.split('=');
queryParams[split[0]] = split[1];
});
}
}