An open API service indexing awesome lists of open source software.

https://github.com/oelin/subjectify

Make all method calls return their call subject.
https://github.com/oelin/subjectify

function-chaining functional-programming

Last synced: 6 months ago
JSON representation

Make all method calls return their call subject.

Awesome Lists containing this project

README

          

# subjectify

Make all method calls return their call subject.

## Installation

```sh
npm i subjectify
```

## Usage

Original code:

```js
const element = document.createElement('div')

element.setAttribute('class', 'foo')
element.setAttribute('id', 'bar')
element.append('hello world')
```

Simplified code using `subjectify()`:

```js
import subjectify from 'subjectify'

const element = subjectify(document.createElement('div'))
.setAttribute('class', 'foo')
.setAttribute('id', 'bar')
.append('hello world')
```