Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Eric Lakatos staghouse

🏠
Working from home
  • Disney
  • East Northport, NY
View GitHub Profile
@staghouse
staghouse / Sorting function for objects
Created Feb 13, 2019
Expects a string with a ':' delimiter. Meant for Vue.js select markup elements and table rendering
View Sorting function for objects
sortBy(event = '') {
let values = event.currentTarget
? event.currentTarget.value.split(':')
: event.split(':');
let cfg = {
prop: values[0],
desc: values[1] ? -1 : 1,
parser: function(x) {
return x;
},