{"id":16934248,"url":"https://github.com/hansihe/live_data","last_synced_at":"2025-09-13T16:48:32.468Z","repository":{"id":62430823,"uuid":"365630023","full_name":"hansihe/live_data","owner":"hansihe","description":null,"archived":false,"fork":false,"pushed_at":"2024-04-27T11:09:29.000Z","size":310,"stargazers_count":118,"open_issues_count":15,"forks_count":2,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-05-09T00:08:57.832Z","etag":null,"topics":["elixir","phoenix"],"latest_commit_sha":null,"homepage":"https://hex.pm/packages/live_data","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hansihe.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-05-08T23:29:32.000Z","updated_at":"2025-02-17T08:03:01.000Z","dependencies_parsed_at":"2023-12-25T16:23:06.896Z","dependency_job_id":null,"html_url":"https://github.com/hansihe/live_data","commit_stats":{"total_commits":31,"total_committers":2,"mean_commits":15.5,"dds":0.06451612903225812,"last_synced_commit":"b276b460a631d4134875957dc286899c4d91beff"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hansihe%2Flive_data","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hansihe%2Flive_data/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hansihe%2Flive_data/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hansihe%2Flive_data/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hansihe","download_url":"https://codeload.github.com/hansihe/live_data/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253166521,"owners_count":21864482,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["elixir","phoenix"],"created_at":"2024-10-13T20:51:39.490Z","updated_at":"2025-05-09T00:09:03.637Z","avatar_url":"https://github.com/hansihe.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LiveData\n\nLiveData can be summarized as LiveView but for JSON data.\n\nLiveData makes it easy to add efficient live updating or interactivity to your existing SPA or native app.\n\nA core concept in LiveData is a tracked function, declared using `deft` instead of the regular `def`. Tracked functions make is possible to separate out static parts of your data structure at compile time, only sending them to the client once.\n\nValues in a `deft` can also be marked with a key using [`keyed`](https://hexdocs.pm/live_data/LiveData.html#module-keys). This approach is inspired by frameworks like React, and makes it possible for the LiveData runtime to efficiently detect changes in your data without having to do an inefficient tree diff.\n\n```elixir\ndefmodule DataViewDemo.SimpleData do\n  use LiveData\n\n  def mount(_params, socket) do\n    {:ok, _tref} = :timer.send_after(1000, :tick)\n    socket = assign(socket, :counter, 0)\n    {:ok, socket}\n  end\n\n  def handle_info(:tick, socket) do\n    {:ok, _tref} = :timer.send_after(1000, :tick)\n    socket = assign(socket, :counter, socket.assigns.counter + 1)\n    {:ok, socket}\n  end\n  \n  # The render function is a `deft` function, and is called any \n  # time there is a change to assigns, just like in LiveView.\n  #\n  # The LiveData runtime takes care of efficient transmission of \n  # changes to the client.\n  deft render(assigns) do\n    %{\n      \"counter\" =\u003e assigns.counter,\n    }\n  end\n  \nend\n\n```\n\nFor an introduction to the project, you can watch this talk from ElixirConf EU 2022:\n\n[![LiveData talk at ElixirConf EU 2022](https://img.youtube.com/vi/I4vVxtrow-E/0.jpg)](https://www.youtube.com/watch?v=I4vVxtrow-E)\n\n## Installation\n\nIf [available in Hex](https://hex.pm/docs/publish), the package can be installed\nby adding `phoenix_data_view` to your list of dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [\n    {:data_view, \"~\u003e 0.1.0\"}\n  ]\nend\n```\n\nDocumentation can be generated with [ExDoc](https://github.com/elixir-lang/ex_doc)\nand published on [HexDocs](https://hexdocs.pm). Once published, the docs can\nbe found at [https://hexdocs.pm/phoenix_data_view](https://hexdocs.pm/phoenix_data_view).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhansihe%2Flive_data","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhansihe%2Flive_data","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhansihe%2Flive_data/lists"}