Trigger a frame update in javascript

You can use request js to make the request. It is a wrapper around the fetch api that handles alot of stuff for you like crsf tokens and also turbo-streams. It will automatically return turbo-streams if you set a turbo stream response but you can also specify it as the response kind that you want. Here is an example.

await post('localhost:3000/posts')

Now it should respond with your turbo stream responses and run them automatically
you can also specify turbo-stream as the response intended with responseKind option

await post('localhost:3000/posts', { responseKind: "turbo-stream" )

checkout the github repo for more info GitHub - rails/request.js