UNPKG

domtastic

Version:

Small, fast, and modular DOM and event library for modern browsers.

27 lines (21 loc) 543 B
/** * @module noConflict */ import { win } from './util'; /* * Save the previous value of the global `$` variable, so that it can be restored later on. * @private */ const previousLib = win.$; /** * In case another library sets the global `$` variable before DOMtastic does, * this method can be used to return the global `$` to that other library. * * @return {Object} Reference to DOMtastic. * @example * var domtastic = $.noConflict(); */ export const noConflict = function() { win.$ = previousLib; return this; };