Skip to content

Instantly share code, notes, and snippets.

function set(label, value) {
const labels = Array.prototype.slice.call(document.getElementsByTagName('label'))
const matches = labels.filter((e)=>e.textContent === label)
if (matches.length === 0) {
return
}
if (matches.length > 1) {
throw new Error('Got more than one match for "' + label + '"')
}
const matchedLabel = matches[0]
@dobiedad
dobiedad / gist:8c70d77d1f2412096a6e7a215779bd20
Last active December 10, 2018 09:40
Changing a property React+Redux vs Hyperdom

Hyperdom

import hyperdom from 'hyperdom'
import h from 'hyperdom.....'
import renderProductGrid from '../productGrid'

class Orders {
  constructor(options){
    this.products = []