/anticipate

A simple function to ensure that a remote resource has loaded before you try to use it.

Primary LanguageJavaScriptGNU General Public License v3.0GPL-3.0

anticipate

A simple promise function to ensure that a remote resource has loaded before you try to use it.

Example:

(function () {
  anticipate(() => window.analytics).then(() => {
    window.analytics.identify('1234', { name: 'Johnny Appleseed' })
  })
})()