{"id":16140811,"url":"https://github.com/nitwel/rdot","last_synced_at":"2025-10-27T22:35:09.111Z","repository":{"id":232097717,"uuid":"783467005","full_name":"Nitwel/Rdot","owner":"Nitwel","description":"JavaScript Signals for Godot!","archived":false,"fork":false,"pushed_at":"2024-04-24T14:00:09.000Z","size":314,"stargazers_count":64,"open_issues_count":3,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-01T19:48:23.685Z","etag":null,"topics":["godot","qwik","reactivity","solidjs","vue"],"latest_commit_sha":null,"homepage":"","language":"GDScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Nitwel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2024-04-08T00:13:14.000Z","updated_at":"2025-03-28T03:11:50.000Z","dependencies_parsed_at":"2024-04-24T15:27:20.088Z","dependency_job_id":"9d9de911-623b-49a2-a9b2-b794c4528087","html_url":"https://github.com/Nitwel/Rdot","commit_stats":null,"previous_names":["nitwel/rdot"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Nitwel/Rdot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nitwel%2FRdot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nitwel%2FRdot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nitwel%2FRdot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nitwel%2FRdot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Nitwel","download_url":"https://codeload.github.com/Nitwel/Rdot/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nitwel%2FRdot/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281355372,"owners_count":26486897,"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","status":"online","status_checked_at":"2025-10-27T02:00:05.855Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["godot","qwik","reactivity","solidjs","vue"],"created_at":"2024-10-09T23:53:52.252Z","updated_at":"2025-10-27T22:35:09.094Z","avatar_url":"https://github.com/Nitwel.png","language":"GDScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Rdot (JavaScript Signals for Godot! 🥳)\n\n\u003cimg alt=\"logo\" src=\"banner.png\" height=\"200\"\u003e\n\n## What is Rdot?\n\nRdot is inspired by most modern Web Frameworks that use a reactive programming model. It enables you to write GDScript with syntax similar to [Vue](https://vuejs.org/) / [Solid](https://www.solidjs.com/) / [Qwik](https://qwik.dev/) and many other Frameworks... but in Godot!\n\n![example](example.gif)\n\nThe most common use case for Rdot is to synchronize the state of your game with the UI, although it can be used for other things as well.\n\n## ⚠️ Disclaimer ⚠️\n\nThis should be seen as a proof of concept and **not ready for production**. While most logic was ported over, there still needs to be more testing to be done.\n\nLogic was sourced from [proposal-signals](https://github.com/proposal-signals/proposal-signals) and translated to GDScript.\nBig shoutout to everyone who contributed to the proposal or worked on the demo in said proposal. ❤️\n\n## Usage\n\n```gdscript\nvar counter = R.state(0)\n\nvar displayText = R.computed(func(_ignore):\n    return \"Counter: \" + str(counter.value)\n)\n\n$AddButton.button_down.connect(func(): counter.value += 1)\n$SubtractButton.button_down.connect(func(): counter.value -= 1)\n\nR.effect(func(_ignore):\n    $CounterLabel.text = displayText.value\n)\n```\n\nSee [Explanation](#Explanation) for a walkthrough of the code.\nMore examples can be found in the [demo](https://github.com/Nitwel/Rdot/tree/main/demo) folder.\n\n### Stores\n\nStores offer the ability to quickly create many reactive states at once. They are useful for managing the state of your game.\n\n```gdscript\n\nvar store = R.store({ # or R.state({ ... })\n    \"counter\": 0,\n    \"name\": \"John Doe\"\n})\n\nR.effect(func(_ignore):\n    $CounterLabel.text = \"Counter: \" + str(store.counter)\n)\n\n```\n\nThe benefit of this is that you can avoid having to access the value via the `value` property.\nStores support also nested objects, allowing you to create more complex states.\n\n`R.state` automatically creates a store when an object is passed as an argument.\n\n### Binding\n\nBinding is a way to synchronize the state of a reactive value with the UI. It can be used to create 1-way or 2-way bindings.\n\n```gdscript\nvar number = R.state(0)\nvar message = R.state(\"Hello World\")\n\n# 1-way binding\nR.bind($Label, \"text\", message)\n\n# 2-way binding\nR.bind($Slider, \"value\", number, $Slider.value_changed)\n```\n\nThere is an edge-case for bindings using Stores. When binding to a store, you have to pass the store as well as the key you want to bind to.\n\n```gdscript\nvar store = R.store({\n    \"counter\": 0,\n    \"name\": \"John Doe\"\n})\n\nR.bind($Label, \"text\", store, \"name\")\nR.bind($Slider, \"value\", store, \"counter\", $Slider.value_changed)\n```\n\n### Explanation\n\n`R.` (R-dot) is the namespace for all Rdot functions.\n\n`R.state` is a function that creates a reactive state. It returns an object with a `value` property that you can read and write to.\nThe methods `do_get` and `do_set(value)` are also available but behave the same as `value`.\n```gdscript\nvar counter = R.state(0)\n```\n\n`R.computed` recalculated it's value each time a reactive value in the function changes. It returns an object with a `value` property that you can read.\nThe first argument can be ignored but has to be there for Godot to not complain.\n```gdscript\nvar double = R.computed(func(_ignore):\n    return counter.value * 2\n)\n```\n\n`R.effect` can be used to synchronize the reactive state with the UI. It its rerun each time a reactive value in the function changes.\n\n```gdscript\nR.effect(func(_ignore):\n    print(\"Double changed: \", double.value)\n)\n```\n\n## API\n\n```gdscript\n## Creates a reactive state\nR.state(initialValue: Variant) -\u003e R.RdotState | RdotStore\n\n## Creates a computed state based on the returned value of the function\nR.computed(func: Callable) -\u003e R.RdotComputed\n\n## Runs the function each time a reactive value in the function changes\n## Returns a function to stop the effect\nR.effect(func: Callable) -\u003e Callable\n\n## Creates a Store based off of a Dictionary\nR.store(initialValue: Dictionary) -\u003e RdotStore\n\n## Updates the target property when the value changes\n## When a watch_signal is provided, the value will be updated when the signal is emitted (2 way binding)\n## Returns a function to stop the binding\nR.bind(target: Object, property: String, value: R.RdotState | R.RdotComputed, watch_signal: Signal = null) -\u003e Callable\n\n## For binding to a store\nR.bind(target: Object, property: String, store: RdotStore, key: String, watch_signal: Signal = null) -\u003e Callable\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnitwel%2Frdot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnitwel%2Frdot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnitwel%2Frdot/lists"}