INNER CODE UNIT · JavaScript

poll

autokitteh/autokitteh · internal/backend/webtools/web/webmessages/app.js:45

  const poll = async () => {
    const msgs = await get()
    for (msg of msgs) {
      const t = new Date(msg.created_at)
      if (last_msg_timestamp && t <= last_msg_timestamp) {
        continue
      }

      last_msg_timestamp = t

      newMessage(msg)
    }
  }

  poll()

  setInterval(poll, 1000)
}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…