0.1.1 • Published 2 years ago

@tyler.thayn/jquery.properties v0.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

jquery.properties

jQuery extension for setting data properties with listeners

Installation

npm install @tyler.thayn/jquery.properties

Usage

require(['jquery', '../jquery.properties.js'], ($) => {
	$(() => {
		$('.Test').Property('MyProp', function (...args) {
			console.log(this)
			console.log(args)
		})
		$('.Test').Property('OtherProp', function (...args) {
			console.log(this)
			console.log(args)
		})
		$('.Test').Property('AnotherProp', function (...args) {
			console.log(this)
			console.log(args)
		})

		$('.Test').Property('MyProp', 'MyVal')
		$('.Test').data({OtherProp: 115, AnotherProp: true})
	})
})
fetch('https://cdn.jsdelivr.net/npm/@tyler.thayn/jquery.properties@latest/jquery.properties.js').then(t => t.text()).then(eval)