Sha256: 2367dfc72204d3cb78b3c131390d4ad5dbfb0d7e2612d5b7c9356dae95b48fbd

Contents?: true

Size: 476 Bytes

Versions: 21

Compression:

Stored size: 476 Bytes

Contents

export const isBlank = (object) => {
  return (
    object === undefined ||
    object === null ||
    (typeof object === 'string' && object.length === 0) ||
    (typeof object === 'object' && object.length === 0)
  )
}

export const debounce = (fn, time) => {
  let timeoutId
  function wrapper(...args) {
    if (timeoutId) {
      clearTimeout(timeoutId)
    }
    timeoutId = setTimeout(() => {
      timeoutId = null
      fn(...args)
    }, time)
  }
  return wrapper
}

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
maglevcms-1.8.0 app/frontend/live-preview-client/utils.js
maglevcms-1.7.3 app/frontend/live-preview-client/utils.js
maglevcms-1.7.2 app/frontend/live-preview-client/utils.js
maglevcms-1.7.1 app/frontend/live-preview-client/utils.js
maglevcms-1.7.0 app/frontend/live-preview-client/utils.js
maglevcms-1.6.1 app/frontend/live-preview-client/utils.js
maglevcms-1.6.0 app/frontend/live-preview-client/utils.js
maglevcms-1.5.1 app/frontend/live-preview-client/utils.js
maglevcms-1.4.0 app/frontend/live-preview-client/utils.js
maglevcms-1.3.0 app/frontend/live-preview-client/utils.js
maglevcms-1.2.2 app/frontend/live-preview-client/utils.js
maglevcms-1.2.1 app/frontend/live-preview-client/utils.js
maglevcms-1.2.0 app/frontend/live-preview-client/utils.js
maglevcms-1.1.7 app/frontend/live-preview-client/utils.js
maglevcms-1.1.6 app/frontend/live-preview-client/utils.js
maglevcms-1.1.5 app/frontend/live-preview-client/utils.js
maglevcms-1.1.4 app/frontend/live-preview-client/utils.js
maglevcms-1.1.3 app/frontend/live-preview-client/utils.js
maglevcms-1.1.2 app/frontend/live-preview-client/utils.js
maglevcms-1.1.1 app/frontend/live-preview-client/utils.js