Skip to content

Commit

Permalink
Rename to function to page_bundle_path/1
Browse files Browse the repository at this point in the history
  • Loading branch information
bartblast committed Oct 26, 2024
1 parent cff6aae commit d76a0fd
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions lib/hologram/router/helpers.ex
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ defmodule Hologram.Router.Helpers do
@doc """
Returns the relative URL of a page's JavaScript bundle using the page's digest.
"""
@spec page_bundle_asset_path(String.t()) :: String.t()
def page_bundle_asset_path(page_digest) do
@spec page_bundle_path(String.t()) :: String.t()
def page_bundle_path(page_digest) do
"/hologram/page-#{page_digest}.js"
end

Expand Down
2 changes: 1 addition & 1 deletion lib/hologram/ui/runtime.ex
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ defmodule Hologram.UI.Runtime do
{/if}
{%if !@page_mounted?}
<script async src={RouterHelpers.page_bundle_asset_path(@page_digest)}></script>
<script async src={RouterHelpers.page_bundle_path(@page_digest)}></script>
{/if}
"""
end
Expand Down
4 changes: 2 additions & 2 deletions test/elixir/hologram/router/helpers_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ defmodule Hologram.Router.HelpersTest do
end
end

test "page_bundle_asset_path/1" do
assert page_bundle_asset_path("abc") == "/hologram/page-abc.js"
test "page_bundle_path/1" do
assert page_bundle_path("abc") == "/hologram/page-abc.js"
end

describe "page_path/1" do
Expand Down

0 comments on commit d76a0fd

Please sign in to comment.