         assign @conn is read only.
         """
     end
+    assigns_to_update = Enum.into(assigns, %{})
 
     view = view || Drab.get_view(socket)
-
     partial =
       if partial_name, do: Partial.hash_for_view_and_name(view, partial_name), else: index(socket)
 
     current_assigns = assign_data_for_partial(socket, partial, partial_name, :assigns)
-
-    current_assigns_keys = Map.keys(current_assigns)
-    assigns_to_update = Enum.into(assigns, %{})
+    nodrab_assigns = assign_data_for_partial(socket, partial, partial_name, :nodrab)
+    all_assigns = all_assigns(assigns_to_update, current_assigns, nodrab_assigns)
+
+    html = rerender_template(socket, view, partial, all_assigns)
+
+    update_javascripts =
+      update_javascripts(socket, html, partial, assigns_to_update, current_assigns)
+    assign_updates = assign_updates_js(assigns_to_update, partial, drab_commander_id(socket))
+    all_javascripts = (assign_updates ++ update_javascripts) |> Enum.uniq() |> Enum.join(";")
+
+    # IO.inspect update_javascripts
+    # IO.inspect(all_javascripts)
+
+    case function.(socket, all_javascripts) do
+      {:ok, _} ->
+        update_assigns_cache(socket, assigns_to_update, partial, drab_commander_id(socket))
+        socket
+
+      {:error, _} = other ->
+        other
+
+      {:timeout, _} = other ->
+        other
+
+      # poke! with exec_js!
+      _ ->
+        :ok
+    end
+  end
+
+  defp all_assigns(assigns, current_assigns, nodrab_assigns) do
+    updated_assigns = Map.merge(current_assigns, assigns)
+    all_assigns = Map.merge(nodrab_assigns, updated_assigns)
+    Enum.into(all_assigns, [])
+  end
+
+  defp rerender_template(socket, view, partial, all_assigns) do
+    template = Partial.template_filename(view, partial)
+    html = Phoenix.View.render_to_string(view, template, all_assigns)
+    update_csrf_token(html, csrf_token(socket))
+  end
+
+  defp assigns_to_update_keys(assigns_to_update, current_assigns_keys) do
     assigns_to_update_keys = Map.keys(assigns_to_update)
 
     for as <- assigns_to_update_keys do

      end
    end

    updated_assigns =
      current_assigns
      |> Enum.into([])
      |> Keyword.merge(assigns)

    amperes_to_update = Partial.amperes_for_assigns(partial, assigns_to_update_keys)

    # update only those which are in shared commander
    amperes_to_update =
      case socket.assigns[:__sender_drab_commander_amperes] do
        [] ->
          amperes_to_update

        sender_drab_commader_amperes ->
          intersection(amperes_to_update, sender_drab_commader_amperes)
      end

    shared_commander_id = drab_commander_id(socket)

    nodrab_assigns =
      socket |> assign_data_for_partial(partial, partial_name, :nodrab) |> Enum.into([])

    all_assigns = Keyword.merge(nodrab_assigns, updated_assigns)

    template = Partial.template_filename(view, partial)
    # t0 = :os.system_time(:milli_seconds)
    html = Phoenix.View.render_to_string(view, template, all_assigns)
    html = Floki.parse(html)
    html = update_csrf_token(html, csrf_token(socket))

    # TODO: this is a very naive way of sorting JS. Small goes first.
    update_javascripts =
      html
      |> update_javascripts(partial, amperes_to_update)
      |> Enum.sort_by(&has_amperes/1)

    assign_updates = assign_updates_js(assigns_to_update, partial, shared_commander_id)
    all_javascripts = (assign_updates ++ update_javascripts) |> Enum.uniq()

    # IO.inspect update_javascripts
    # IO.inspect(all_javascripts)

    case function.(socket, all_javascripts |> Enum.join(";")) do
      {:ok, _} ->
        update_assigns_cache(socket, assigns_to_update, partial, shared_commander_id)
        socket

      {:error, _} = other ->
        other

      {:timeout, _} = other ->
        other

      _ -> :ok # poke! with exec_js!
    end
  end

  defp update_javascripts(html, partial, amperes_to_update) do
    for ampere <- amperes_to_update,
        %Ampere{gender: gender, tag: tag, attribute: prop_or_attr} <-
          Partial.partial(partial).amperes[ampere] do
      case gender do
        :html -> update_html_js(html, ampere, tag)
        :attr -> update_attr_js(html, ampere, prop_or_attr)
        :prop -> update_prop_js(html, ampere, prop_or_attr)
      end
    end
  end

  defp update_html_js(html, ampere, tag) do

    peek(socket, view, partial, String.to_existing_atom(assign))
  end

  @doc """
  Updates the current page in the browser with the new assign value.

