Skip to content

Instantly share code, notes, and snippets.

View juan-rod's full-sized avatar

Juan Rodriguez juan-rod

View GitHub Profile
@juan-rod
juan-rod / group-objects-by-property.md
Created December 5, 2019 13:47 — forked from mikaello/group-objects-by-property.md
Group Array of JavaScript Objects by Key or Property Value

Group Array of JavaScript Objects by Keys or Property Values

This fork of JamieMason's implementation changes the key parameter to be an array of keys instead of just a single key. This makes it possible to group by multiple properties instead of just one.

Implementation

const groupBy = keys => array =>
  array.reduce((objectsByKeyValue, obj) => {
    const value = keys.map(key => obj[key]).join('-');
@juan-rod
juan-rod / vue.debug.js
Created August 7, 2019 16:18 — forked from Rebolon/vue.debug.js
A solution to use debugger in v-for for VueJS
<ul id="pages-block">
<li v-for="page in pages">
<a v-bind:href="page.url">{{page.name}}</a>
<debug :item="page"/>
</li>
</ul>
...
Vue.component('debug', {
@juan-rod
juan-rod / ACA__intro-cheatsheet.md
Last active March 7, 2019 21:34
quick look at standards and commands for intro to web 101

test

import { shallowMount } from '@vue/test-utils'
import AppCheckbox from '@/shared/components/inputs/AppCheckbox'
import { VueLoaderPlugin } from 'vue-loader';
describe('AppCheckbox', () => {
let wrapper
beforeEach(() => {
wrapper = shallowMount(AppCheckbox, {
propsData: {
value: false,