Sha256: ebe218a069323a0834a1f05ea3c25b8caa7a4b40ff281c41c7d4d1f87944245a
Contents?: true
Size: 797 Bytes
Versions: 19
Compression:
Stored size: 797 Bytes
Contents
((window) -> ( window.waitFor ||= (key, deepCheck, interval) -> (callback) -> _timer = null _called = false setTimeout (-> unless _called console.warn "not loaded component [#{key}] in #{waitFor.timeout}", typeof window[key] ), waitFor.timeout checker = -> return if _called || typeof window[key] is 'undefined' if typeof deepCheck is 'function' return unless deepCheck.call(window[key]) clearInterval(_timer) _called = true return unless typeof callback is 'function' callback.call(window[key], window[key]) _timer = setInterval(checker, interval || waitFor.tick) checker() null window.waitFor.timeout ||= 30000 window.waitFor.tick ||= 100 ))(window)
Version data entries
19 entries across 19 versions & 1 rubygems