Skip to content

Latest commit

 

History

History
32 lines (27 loc) · 1.12 KB

README.md

File metadata and controls

32 lines (27 loc) · 1.12 KB

brisky-props

Build Status js-standard-style npm version Coverage Status

Set attributes on brisky-elements

  const render = require('brisky/render')
  const s = require('vigour-state/s')
  const state = s({ thumb: 'cat' })

  const app = render({
    img: {
      tag: 'img',
      props: {
        src: {
          $: 'thumb',
          $transform: (val) => `http://bla.com/${val}.jpg`
        }
      }
    }
  }, state)

  document.body.appendChild(app)

  state.cat.thumb('dog') // → changes thumb to dog