mirror of
https://github.com/woutdp/live_svelte
synced 2026-05-24 09:28:21 +00:00
Run formatter
This commit is contained in:
parent
7df27c86cf
commit
fa26e6b0f5
6 changed files with 21 additions and 21 deletions
10
CHANGELOG.md
10
CHANGELOG.md
|
|
@ -9,7 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||
|
||||
### Added
|
||||
|
||||
- Added [LiveSvelte Components Macro](https://github.com/woutdp/live_svelte#the-components-macro) - [PR](https://github.com/woutdp/live_svelte/pull/50)
|
||||
- Added [LiveSvelte Components Macro](https://github.com/woutdp/live_svelte#the-components-macro) - [PR](https://github.com/woutdp/live_svelte/pull/50)
|
||||
|
||||
## [0.7.1] - 2023-06-03
|
||||
|
||||
|
|
@ -21,18 +21,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||
|
||||
### Added
|
||||
|
||||
- Added `pushEventTo`
|
||||
- Added `pushEventTo`
|
||||
|
||||
## [0.6.0] - 2023-05-26
|
||||
|
||||
### Added
|
||||
|
||||
- Install instructions on importing LiveSvelte inside `html_helpers` so `<.svelte />` is possible.
|
||||
- Install instructions on importing LiveSvelte inside `html_helpers` so `<.svelte />` is possible.
|
||||
|
||||
### Changed
|
||||
|
||||
- Deprecated `LiveSvelte.render` in favor of `LiveSvelte.svelte`
|
||||
- Now we're using `<.svelte />` instead of `<LiveSvelte.render />` in the examples
|
||||
- Deprecated `LiveSvelte.render` in favor of `LiveSvelte.svelte`
|
||||
- Now we're using `<.svelte />` instead of `<LiveSvelte.render />` in the examples
|
||||
|
||||
## [0.5.1] - 2023-05-06
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
<div align="center">
|
||||
|
||||
# LiveSvelte
|
||||
|
||||
[](https://github.com/woutdp/live_svelte)
|
||||
[](https://hex.pm/packages/live_svelte)
|
||||
|
||||
|
|
@ -245,7 +246,6 @@ _Note: that here we use the `pushEvent` function, but you could also use `phx-cl
|
|||
|
||||
_`pushEventTo` is available too and works exactly the same way as specified in the [documentation](https://hexdocs.pm/phoenix_live_view/js-interop.html#client-hooks-via-phx-hook)._
|
||||
|
||||
|
||||
#### Create a LiveView
|
||||
|
||||
```elixir
|
||||
|
|
|
|||
|
|
@ -26,8 +26,8 @@ import {getHooks} from "live_svelte"
|
|||
import * as SvelteComponents from "../svelte/**/*"
|
||||
|
||||
const Hooks = {
|
||||
...createLiveJsonHooks(),
|
||||
...getHooks(SvelteComponents)
|
||||
...createLiveJsonHooks(),
|
||||
...getHooks(SvelteComponents),
|
||||
}
|
||||
|
||||
let csrfToken = document.querySelector("meta[name='csrf-token']").getAttribute("content")
|
||||
|
|
|
|||
|
|
@ -1,17 +1,17 @@
|
|||
<script>
|
||||
export let big_data_set = {}
|
||||
export let big_data_set
|
||||
</script>
|
||||
|
||||
<h1 class="text-lg">LiveJson demo</h1>
|
||||
<p class="mb-2">Check the websocket to see how much data is being transferred.</p>
|
||||
|
||||
<ul>
|
||||
<li>
|
||||
Key Length: {Object.keys(big_data_set).length}
|
||||
</li>
|
||||
<li>
|
||||
Rough byte size: {JSON.stringify(big_data_set).length}
|
||||
</li>
|
||||
<li>
|
||||
Key Length: {Object.keys(big_data_set).length}
|
||||
</li>
|
||||
<li>
|
||||
Rough byte size: {JSON.stringify(big_data_set).length}
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<button phx-click="remove_element" class="bg-black text-white px-4 py-2 rounded">Remove Element</button>
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ defmodule ExampleWeb.LiveExample6 do
|
|||
def render(assigns) do
|
||||
~H"""
|
||||
<div class="flex justify-center items-center h-full w-full">
|
||||
<form phx-submit="set_name" :if={!@name}>
|
||||
<form :if={!@name} phx-submit="set_name">
|
||||
<!-- svelte-ignore a11y-autofocus -->
|
||||
<input
|
||||
type="text"
|
||||
|
|
@ -21,10 +21,10 @@ defmodule ExampleWeb.LiveExample6 do
|
|||
<button class="py-2 px-4 bg-black text-white rounded">Join</button>
|
||||
</form>
|
||||
<.Chat
|
||||
messages={@messages}
|
||||
name={@name}
|
||||
class="w-full h-full flex justify-center items-center"
|
||||
:if={@name}
|
||||
:if={@name}
|
||||
messages={@messages}
|
||||
name={@name}
|
||||
class="w-full h-full flex justify-center items-center"
|
||||
/>
|
||||
</div>
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ defmodule Example.MixProject do
|
|||
{:telemetry_poller, "~> 1.0"},
|
||||
{:floki, ">= 0.30.0", only: :test},
|
||||
{:phoenix_live_reload, "~> 1.2", only: :dev},
|
||||
{:tailwind, "~> 0.1.8", runtime: Mix.env() == :dev},
|
||||
{:tailwind, "~> 0.1.8", runtime: Mix.env() == :dev}
|
||||
]
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue