Every premium and members-only resource for $9.99/month, as a no-commitment subscription. See the plans

PalateKit

Menu

Request a resource

Describe the resource you are missing in one sentence. We will email you when it is published.

0 / 280

Unlock PalateKit

Unlock everything

Plan

Paying means accepting our terms of sale.

Secure payment by Stripe. Receipts and invoices sent by email.

Welcome back

Sign in to install, download or save this resource. A free account is enough for free resources.

Managing timers and listeners in Kea logic v1.0.0

Use this resource to clean up timers and event listeners inside a Kea logic

New

  • 568 downloads
  • 142 likes
  • 145 saves

Free

Install with the CLI

In a terminal, from the folder you want:

npx --yes palatekit@latest install kea-timers-listeners-cleanup

With no option, the skill goes to ~/.agents/skills/; add --agent claude-code (or codex, cursor…) to target an agent.

First time: connect the CLI with

npx --yes palatekit@latest login

The agent replaces bare setInterval, setTimeout and event listeners with cache.disposables.add and dispose, using a key and the pauseOnPageHidden option. It also converts the existing anti-patterns. You get logic that cleans up on unmount and pauses when the tab is hidden.

Mostly picked by

Updated November 2, 2026

Card for the “Managing timers and listeners in Kea logic” skill

Details

Generates with
Your agent's model
Licence
MIT

Similar resources

View all

What you get

  • SKILL.md: the pattern, key choice and pauseOnPageHidden option
  • SKILL.md: early disposal, examples and anti-patterns to convert

Good fit for

  • Your Kea logic starts a setInterval without clearing it
  • You attach a window or MediaQueryList listener in a Kea logic

Not for

    Tags

    • kea
    • frontend
    • cleanup

    About

    You say

    “Replace the setInterval in my refresh logic with cache.disposables.”

    Card for the “Managing timers and listeners in Kea logic” skill

    Skill published by posthog under the MIT license, delivered in its original version.

    Show more

    How to use it

    1. Install the skill in your agent's skills folder
    2. Ask your agent to clean up timers and event listeners inside a Kea logic
    3. Review and adjust the result

    Content preview

    Files

    • LICENSE1.5 KB
    • NOTICE-PALATEKIT.md0.5 KB
    • SKILL.md11.9 KB

    Origin and licence

    Listed unmodified

    Author
    posthog
    Source
    github.com/posthog/posthog/tree/fcb362bb439b15171da4dfba401bff03ea98bd2b/.agents/skills/using-kea-disposables
    Licence
    MIT

    Notice

    « using-kea-disposables » (posthog, MIT) livré dans sa version d'origine : fiche en français et en anglais par PalateKit.

    User reviews

    –

    No ratings yet

    Loading reviews…

    Delete your review?

    Your rating and comment will be removed from the page.