Skip to content

docs: Add long polling example#1

Open
promptless-for-oss wants to merge 1 commit intoInlinePizza:mainfrom
Promptless:promptless/add-long-polling-example
Open

docs: Add long polling example#1
promptless-for-oss wants to merge 1 commit intoInlinePizza:mainfrom
Promptless:promptless/add-long-polling-example

Conversation

@promptless-for-oss
Copy link

Open this suggestion in Promptless to view citations and reasoning process

Adds a new interactive example demonstrating how to implement long polling in Vue. The example polls the GitHub API for Vue Core commits every 3 seconds, with controls to start/stop polling and proper cleanup on unmount. Includes both Composition API and Options API versions.

Trigger Events

Web UI: Can you add a page to the docs with an example of building a...

Agent Response

I've created a new long polling example for the Vue.js documentation. Here's what was added:

New Example: Long Polling

The example demonstrates how to implement long polling in Vue by periodically fetching data from an API. It includes:

Features:

  • Polls the GitHub API for the latest Vue Core commits every 3 seconds
  • Start/stop controls so users can see the polling behavior
  • Displays the last update timestamp
  • Proper cleanup by stopping the interval when the component unmounts

Files Created:

  • description.txt - Brief description of what the example demonstrates
  • App/template.html - The UI with a toggle button, status indicator, and commit list
  • App/composition.js - Implementation using the Composition API (ref, onUnmounted)
  • App/options.js - Implementation using the Options API (data, methods, beforeUnmount)
  • App/style.css - Styling for the button and commit list

The example follows the same structure as existing examples like fetching-data, so it will automatically appear in the Examples section of the docs with support for both API styles.


Help us improve Promptless — If this suggestion missed the mark, please share quick feedback.

If you want Promptless to make further changes on this PR, feel free to leave a comment tagging Promptless (It won't show up in the user drop down but Promptless will get it!)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant