diff --git a/README.md b/README.md index 1622d8e..b7c6033 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ defmodule MyAppWeb.HelloLive do end # liv/my_app_web/live/hello_live_swiftui.ex -def MyAppWeb.HelloLive.SwiftUI do +defmodule MyAppWeb.HelloLive.SwiftUI do use MyAppNative, [:render_component, format: :swiftui] def render(assigns, %{"target" => "watchos"}) do diff --git a/lib/live_view_native.ex b/lib/live_view_native.ex index f59dcc5..99c331b 100644 --- a/lib/live_view_native.ex +++ b/lib/live_view_native.ex @@ -9,7 +9,7 @@ defmodule LiveViewNative do Phoenix on how to handle certain formats. # registers each plugin for use - config :live_view_native plugins: [ + config :live_view_native, plugins: [ LiveViewNative.SwiftUI, LiveViewNative.Jetpack ] diff --git a/lib/live_view_native/component.ex b/lib/live_view_native/component.ex index 59ded7b..f5c549a 100644 --- a/lib/live_view_native/component.ex +++ b/lib/live_view_native/component.ex @@ -39,7 +39,7 @@ defmodule LiveViewNative.Component do See `LiveViewNative.Renderer.embed_templates/2` for more information. ## Format-Specific Render Component - def MyAppWeb.HomeLive.SwiftUI do + defmodule MyAppWeb.HomeLive.SwiftUI do use LiveViewNative.Component, format: :swiftui, as: :render @@ -47,7 +47,7 @@ defmodule LiveViewNative.Component do In this example `:as` is used and this will inject following: - ember_templates("swiftui/home_live*", root: nil, name: :render) + embed_templates("swiftui/home_live*", root: nil, name: :render) Assuming there is a `swiftui/home_live.swiftui.neex` this will be embeded in the render component as `render/2`. @@ -74,7 +74,7 @@ defmodule LiveViewNative.Component do end ## Format-Specific Function Component - def MyAppWeb.NativeComponent.SwiftUI do + defmodule MyAppWeb.NativeComponent.SwiftUI do use LiveViewNative.Component, format: :swiftui end @@ -97,7 +97,7 @@ defmodule LiveViewNative.Component do end ## Format-Specific Layouts - def MyAppWeb.Layouts.SwiftUI do + defmodule MyAppWeb.Layouts.SwiftUI do use LiveViewNative.Component, format: :swiftui diff --git a/lib/live_view_native/live_view.ex b/lib/live_view_native/live_view.ex index 2a9c5ac..bd499e2 100644 --- a/lib/live_view_native/live_view.ex +++ b/lib/live_view_native/live_view.ex @@ -20,7 +20,7 @@ defmodule LiveViewNative.LiveView do defmodule MyAppWeb.HomeLive do use MyAppWeb, :live_view use LiveViewNative, - formats: [:swiftui, :jatpack], + formats: [:swiftui, :jetpack], layouts: [ swiftui: {MyAppWeb.Layouts.SwiftUI, :app}, jetpack: {MyAppWeb.Layouts.Jetpack, :app}