Packages

Lily is designed to be a web framework for Gleam that allows for real-time updates while preserving offline functionality.

Current section

Files

Jump to
lily src lily@client.erl
Raw

src/lily@client.erl

-module(lily@client).
-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch, inline]).
-define(FILEPATH, "src/lily/client.gleam").
-export([structural_equal/2, start/1, apply_patches/2, set_inner_html/2, mount/2, selective/4, reference_equal/2, set_compare_strategy/2, send_msg/1]).
-if(?OTP_RELEASE >= 27).
-define(MODULEDOC(Str), -moduledoc(Str)).
-define(DOC(Str), -doc(Str)).
-else.
-define(MODULEDOC(Str), -compile([])).
-define(DOC(Str), -compile([])).
-endif.
-file("src/lily/client.gleam", 92).
?DOC(false).
-spec structural_equal(GBA, GBA) -> boolean().
structural_equal(A, B) ->
A =:= B.
-file("src/lily/client.gleam", 136).
-spec initialise(
lily@store:store(GBB, GBC),
fun((lily@store:store(GBB, GBC), GBC) -> lily@store:store(GBB, GBC)),
fun((lily@store:store(GBB, GBC)) -> nil)
) -> nil.
initialise(_, _, _) ->
nil.
-file("src/lily/client.gleam", 145).
-spec set_store_ref(lily@store:store(any(), any())) -> nil.
set_store_ref(_) ->
nil.
-file("src/lily/client.gleam", 45).
-spec start(lily@store:store(any(), any())) -> nil.
start(Store) ->
nil = initialise(Store, fun lily@store:apply/2, fun lily@store:notify/1),
Updated = lily@store:dispatch(Store, erlang:element(2, Store)),
set_store_ref(Updated).
-file("src/lily/client.gleam", 152).
-spec ffi_apply_patches(
binary(),
list({binary(), binary(), binary(), binary()})
) -> nil.
ffi_apply_patches(_, _) ->
nil.
-file("src/lily/client.gleam", 54).
?DOC(false).
-spec apply_patches(binary(), list({binary(), binary(), binary(), binary()})) -> nil.
apply_patches(Selector, Patches) ->
ffi_apply_patches(Selector, Patches).
-file("src/lily/client.gleam", 160).
-spec ffi_set_inner_html(binary(), binary()) -> nil.
ffi_set_inner_html(_, _) ->
nil.
-file("src/lily/client.gleam", 87).
?DOC(false).
-spec set_inner_html(binary(), binary()) -> nil.
set_inner_html(Selector, Html) ->
ffi_set_inner_html(Selector, Html).
-file("src/lily/client.gleam", 31).
-spec mount(binary(), binary()) -> nil.
mount(Selector, Html) ->
set_inner_html(Selector, Html).
-file("src/lily/client.gleam", 167).
-spec ffi_selective(
binary(),
fun((GBQ) -> GBR),
fun((GBR, GBR) -> boolean()),
fun((GBR) -> nil)
) -> fun((GBQ) -> nil).
ffi_selective(_, _, _, _) ->
fun(_) -> nil end.
-file("src/lily/client.gleam", 67).
?DOC(false).
-spec selective(
binary(),
fun((GAW) -> GAX),
fun((GAX, GAX) -> boolean()),
fun((GAX) -> nil)
) -> fun((GAW) -> nil).
selective(Selector, Select, Compare, Handler) ->
ffi_selective(Selector, Select, Compare, Handler).
-file("src/lily/client.gleam", 177).
-spec ffi_reference_equal(GBS, GBS) -> boolean().
ffi_reference_equal(_, _) ->
false.
-file("src/lily/client.gleam", 62).
?DOC(false).
-spec reference_equal(GAV, GAV) -> boolean().
reference_equal(A, B) ->
ffi_reference_equal(A, B).
-file("src/lily/client.gleam", 182).
-spec ffi_set_compare_strategy(binary(), fun((GBT, GBT) -> boolean())) -> nil.
ffi_set_compare_strategy(_, _) ->
nil.
-file("src/lily/client.gleam", 82).
?DOC(false).
-spec set_compare_strategy(binary(), fun((GAZ, GAZ) -> boolean())) -> nil.
set_compare_strategy(Selector, Compare) ->
ffi_set_compare_strategy(Selector, Compare).
-file("src/lily/client.gleam", 218).
-spec ffi_send_msg(any()) -> nil.
ffi_send_msg(_) ->
nil.
-file("src/lily/client.gleam", 77).
?DOC(false).
-spec send_msg(any()) -> nil.
send_msg(Msg) ->
ffi_send_msg(Msg).