MCPcopy Create free account
hub / github.com/TruthHun/BookStack / addGetHookIf

Function addGetHookIf

static/jquery/1.12.4/jquery.js:6819–6836  ·  view source on GitHub ↗
( conditionFn, hookFn )

Source from the content-addressed store, hash-verified

6817
6818
6819function addGetHookIf( conditionFn, hookFn ) {
6820
6821 // Define the hook, we'll check on the first run if it's really needed.
6822 return {
6823 get: function() {
6824 if ( conditionFn() ) {
6825
6826 // Hook not needed (or it's not possible to use it due
6827 // to missing dependency), remove it.
6828 delete this.get;
6829 return;
6830 }
6831
6832 // Hook needed; redefine it so that the support test is not executed again.
6833 return ( this.get = hookFn ).apply( this, arguments );
6834 }
6835 };
6836}
6837
6838
6839var

Callers 1

jquery.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected