How to use the extend/wrapMethod function in extend

To help you get started, we’ve selected a few extend examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ractivejs / ractive / src / config / configuration.js View on Github external
todo_data( Parent, Child, options.data );

		config.forEach( each => {
			each.extend( Parent, Child, options ) }
		);

		for ( let key in options ) {

			if ( !blacklisted[ key ] && options.hasOwnProperty( key ) ) {

				let member = options[ key ]

				// if this is a method that overwrites a method, wrap it:
				if ( typeof member === 'function' ) {
					member = wrapMethod( member, Child.prototype[ key ] );
				}

				Child.prototype[ key ] = member;

			}
		}
	},

extend

Port of jQuery.extend for node.js and the browser

MIT
Latest version published 6 years ago

Package Health Score

74 / 100
Full package analysis