@@ -307,7 +307,7 @@ defmodule Kino.Control do
307307 end
308308
309309 @ doc """
310- Subscribes the calling process to control or input events.
310+ Subscribes the calling process to control, input, or `Kino.JS.Live` events.
311311
312312 This is an alternative API to `stream/1`, such that event
313313 messages are consumed via process messages instead of streams.
@@ -316,18 +316,20 @@ defmodule Kino.Control do
316316 event details. In particular, it always includes `:origin`, which
317317 is an opaque identifier of the client that triggered the event.
318318 """
319- @ spec subscribe ( t ( ) | Kino.Input . t ( ) , term ( ) ) :: :ok
319+ @ spec subscribe ( t ( ) | Kino.Input . t ( ) | Kino.JS.Live . t ( ) , term ( ) ) :: :ok
320320 def subscribe ( source , tag )
321- when is_struct ( source , Kino.Control ) or is_struct ( source , Kino.Input ) do
321+ when is_struct ( source , Kino.Control ) or is_struct ( source , Kino.Input ) or
322+ is_struct ( source , Kino.JS.Live ) do
322323 Kino.SubscriptionManager . subscribe ( source . ref , self ( ) , tag )
323324 end
324325
325326 @ doc """
326- Unsubscribes the calling process from control or input events.
327+ Unsubscribes the calling process from control, input, or `Kino.JS.Live` events.
327328 """
328- @ spec unsubscribe ( t ( ) | Kino.Input . t ( ) ) :: :ok
329+ @ spec unsubscribe ( t ( ) | Kino.Input . t ( ) | Kino.JS.Live . t ( ) ) :: :ok
329330 def unsubscribe ( source )
330- when is_struct ( source , Kino.Control ) or is_struct ( source , Kino.Input ) do
331+ when is_struct ( source , Kino.Control ) or is_struct ( source , Kino.Input ) or
332+ is_struct ( source , Kino.JS.Live ) do
331333 Kino.SubscriptionManager . unsubscribe ( source . ref , self ( ) )
332334 end
333335
0 commit comments