function onTabChange(callback) {
  if (isServer) return false
  const prop = getHiddenProp()
  const event = `${prop.replace(/[H|h]idden/, '')}visibilitychange`
  const handler = () => callback(Boolean(document[prop]))
  const attachFunc = () => document.addEventListener(event, handler)
  attachFunc()
  return () => {
    document.removeEventListener(event, handler)
    return attachFunc
  }
}
Fire a callback on tab visibility changes
@param  {function} callback - function to run on visibility change
@return {function} detach onTabChange listener