Replies: 5 comments 8 replies
-
|
There is someone else asking about Datastar, or are you the same person? Check out https://pocketpages.dev/docs/context-api/send and https://github.com/benallfree/pocketpages/blob/main/starters/htmx/pb_hooks/pages/api/chat.ejs. You’ll need to author a Datastar provider something similar to https://github.com/benallfree/pocketbase-htmx-ext-sse. I adapted that from the official sse package and made it work with PocketBase. Check out the commit history to see the modifications I made, Datastar will need something very similar. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
|
Maybe we have a custom event that signals an update to the subscription connection? Then use |
Beta Was this translation helpful? Give feedback.
-
|
@benallfree this works well when you make an endpoint that responds with SSE. You can call it like this and update the DOM with signals and elements from the SSE response: |
Beta Was this translation helpful? Give feedback.
-
|
Implemented https://pocketpages.dev/docs/plugins/datastar https://www.reddit.com/r/pocketbase/comments/1m9tyv3/datastar_support_added_to_pocketpages/ |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm trying to think about how I might use SSE Events for use with Datastar.
Perhaps, a way to run the resulting HTML through a function that divides nodes into data: fragments or something? This might even make realtime updates easier....
Beta Was this translation helpful? Give feedback.
All reactions