1.0.1 • Published 3 years ago
subjectify v1.0.1
subjectify
Make all method calls return their call subject.
Installation
npm i subjectifyUsage
Original code:
const element = document.createElement('div')
element.setAttribute('class', 'foo')
element.setAttribute('id', 'bar')
element.append('hello world')Simplified code using subjectify():
import subjectify from 'subjectify'
const element = subjectify(document.createElement('div'))
.setAttribute('class', 'foo')
.setAttribute('id', 'bar')
.append('hello world')