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

https://github.com/anonyco/idl-property-observer

Plug changes like HTMLInputElement.value into MutationObservers in 766 bytes. Framework agnostic!
https://github.com/anonyco/idl-property-observer

bad-practices dom-events drop-in easy-to-learn easy-to-use evil framework-agnostic horrible htmlelement library mutation-observer no-dependencies no-jquery npm npm-package shitty-code vanilla-javascript vanilla-js vanillajs worst-js

Last synced: about 1 month ago
JSON representation

Plug changes like HTMLInputElement.value into MutationObservers in 766 bytes. Framework agnostic!

Awesome Lists containing this project

README

        

[![npm version](https://img.shields.io/npm/v/idl-property-observer.svg?label=version)](https://npmjs.org/package/idl-property-observer "View this project on npm")
[![GitHub stars](https://img.shields.io/github/stars/anonyco/IDL-Property-Observer.svg?style=social)](https://github.com/anonyco/IDL-Property-Observer/stargazers "View others who have stared this repository")
[![GitHub file size in bytes](https://img.shields.io/github/size/anonyco/IDL-Property-Observer/dist/IDLPropertyObserver.min.js?label=without%20gzip)](https://github.com/anonyco/IDL-Property-Observer/blob/master/dist/IDLPropertyObserver.min.js "File without gzip")
[![GitHub file size in bytes](https://img.shields.io/github/size/anonyco/IDL-Property-Observer/IDLPropertyObserver.min.js.gz.svg?label=gzip%20applied)](https://github.com/anonyco/IDL-Property-Observer/blob/master/IDLPropertyObserver.min.js.gz "Gzipped file")
[![npm bundle size (version)](https://img.shields.io/bundlephobia/min/idl-property-observer/latest.svg?color=maroon&label=NPM%20bundle%20size)](https://npmjs.org/package/idl-property-observer "View this project on npm")
[![Issues](https://img.shields.io/github/issues/anonyco/IDL-Property-Observer.svg)]( https://github.com/anonyco/IDL-Property-Observer/issues )
[![Unlicense license](https://img.shields.io/badge/license-Unlicense-brightgreen.svg)](https://unlicense.org/ "This project's liscence")
[![npm downloads](https://img.shields.io/npm/dt/idl-property-observer.svg)](https://npmjs.org/package/idl-property-observer "View this project on npm")

# IDL-Property-Observer
Plug changes like HTMLInputElement.value into MutationObservers. Framework agnostic! **This library is not responsible for your decision to utilize the poor programming practices that this library shamelessly represents!** This library overwrites native prototypes. Please only use this library as a last-resort if you have a finished project and do not have the time to go back and change the code to fire a common handler on IDL property changes.

### Quick Start

Drop the following above your code in the HTML of the page. I call this library "framework agnostic" because whatever framework, build system, or language abstraction (such as CoffeeScript) you are using (if any), there is likely a way to include this library above your code in the page.

````HTML

````

Preferably, it would be best to copy and paste the code into your main or bundled Javascript code file inorder to lower network requests and make the page load faster. If this is not possible due to the framework, build system, or language abstraction that you are using, then at least try to add defer="" to all of the scripts so that the browser can download this script from dropbox in synchrony with the one from your website.

````HTML

````

The use of dropbox allows me to push out new versions that address any bugs that I find and such. As I have no big plans or intentions for this library in the future, I will never push up a breaking change that could damage your website. Only bug-fixes will be applied.

### API

There is no API. This library is merely a monkey-patch for the spotty behavior of Mutation Observers. Observe as the mutation observer fails horribly.

```Javascript
var input = document.createElement("input");
var observer = new MutationObserver(function(records){
for (var i=0; i