Hello, I have a long list which is hard coded in my project you can find it: mishka_template_creator/tailwind_setting.ex at master · mishka-group/mishka_template_creator · GitHub
When I want to find something in the list, I use these functions:
and call it in my Phoenix LiveView component:
attr :id, :string, required: true
attr :child, :string, required: false, default: nil
defp create_form(%{id: id, child: child} = assigns) do
assigns = assign(assigns, :selected_setting, TailwindSetting.get_form_options(id, child))
You can find this function in my code:
Now the problem, for example if I find border-color
in the list (first link), phoenix liveview sends request to backend with a delay
I recorded a video you can see:
https://user-images.githubusercontent.com/8413604/226173567-ab2c5c2a-65c6-47c2-8357-49aa290e14f0.mp4
As you see when I clicked in border-color
section which is very long and has many items, it is going to send a request with a delay, what is your solution?
I think there is no problem in the Elixir part, and it is getting faster, but the request from JavaScript phx-click
seems to be sent with delay.
Because its calculation is very fast when the HTML is not created. I don’t know how to use LiveView stream
or temporary_assign
in a component
link: mishka_template_creator/settings.ex at master · mishka-group/mishka_template_creator · GitHub
Thank you in advance