@@ -126,24 +126,23 @@ defmodule Phoenix.Sync.Client do
126126 @ spec stream ( Phoenix.Sync . shape_definition ( ) , Electric.Client . stream_options ( ) ) :: Enum . t ( )
127127 def stream ( shape , stream_opts \\ [ ] )
128128
129+ def stream ( table , stream_opts ) when is_binary ( table ) and is_list ( stream_opts ) do
130+ stream ( Keyword . put ( stream_opts , :table , table ) , [ ] )
131+ end
132+
129133 def stream ( shape , [ ] ) when is_list ( shape ) do
130134 { client , shape } = Keyword . pop_lazy ( shape , :client , & new! / 0 )
131135
132- { shape , shape_stream_opts } = resolve_shape ( shape )
136+ { shape , shape_stream_opts } = resolve_shape ( shape , [ ] )
133137
134138 Electric.Client . stream ( client , shape , shape_stream_opts )
135139 end
136140
137- def stream ( table , stream_opts ) when is_binary ( table ) and is_list ( stream_opts ) do
138- stream ( Keyword . put ( stream_opts , :table , table ) , [ ] )
139- end
140-
141141 def stream ( shape , stream_opts ) when not is_list ( shape ) and is_list ( stream_opts ) do
142142 { client , stream_opts } = Keyword . pop_lazy ( stream_opts , :client , & new! / 0 )
143+ { shape , shape_stream_opts } = resolve_shape ( shape , stream_opts )
143144
144- { shape , shape_stream_opts } = resolve_shape ( shape )
145- stream_opts = Keyword . merge ( shape_stream_opts , stream_opts )
146- Electric.Client . stream ( client , shape , stream_opts )
145+ Electric.Client . stream ( client , shape , shape_stream_opts )
147146 end
148147
149148 defp resolve_shape ( shape , stream_opts ) do
0 commit comments