Skip to content

Instantly share code, notes, and snippets.

Avatar
🚑
Git problems? Better Call Luca

Andrew Luca iamandrewluca

🚑
Git problems? Better Call Luca
View GitHub Profile
View 00-ReduxFormDocsDeploy.md

Directory structure

View Icon.jsx
import React from 'react';
const {PropTypes} = React;
import iconPaths from './selection.js';// the file exported from IcoMoon
const foundIcons = {};
function getPath(iconName) {
if (foundIcons[iconName]) {
return foundIcons[iconName];
@iamandrewluca
iamandrewluca / event-delegate.js
Created Sep 7, 2017 — forked from mhairston/event-delegate.js
Event Delegation with Plain JavaScript
View event-delegate.js
// Event Delegation with Plain Javascript
// from Adam Beres-Deak
// http://bdadam.com/blog/plain-javascript-event-delegation.html
function on(elSelector, eventName, selector, fn) {
var element = document.querySelector(elSelector);
element.addEventListener(eventName, function(event) {
var possibleTargets = element.querySelectorAll(selector);
var target = event.target;
You can’t perform that action at this time.