{"repo":"nank1ro/solidart","free":true,"listed":false,"github":"https://github.com/nank1ro/solidart","clone":"git clone https://github.com/nank1ro/solidart.git","description":"Signals in Dart and Flutter, inspired by SolidJS","language":"Dart","stars":230,"topics":["dart","flutter","signals","solidjs","state-management","solidart"],"license":"MIT","category":"mobile-apps","readme_excerpt":"A simple state-management library inspired by SolidJS. The objectives of this project are: 1. Being simple and easy to learn 2. Fits well with the framework's good practices 3. Do not have a single global state, but multiple states only in the most appropriate places 4. No code generation Learning For a comprehensive and updated documentation go to The Official Documentation There are 5 main concepts you should be aware: 1. Signal 2. Effect 3. Computed 4. Resource 5. Dependency Injection Signal Signals are the cornerstone of reactivity in solidart . They contain values that change over time; when you change a signal's value, it automatically updates anything that uses it. To create a signal, you have to use the Signal class: The argument passed to the class is the initial value, and the return value is the signal. To retrieve the current value, you can use: To change the value, you can use: Effect Signals are trackable values, but they are only one half of the equation. To complement those are observers that can be updated by those trackable values. An effect is one such observer; it runs a side effect that depends on signals. An effect can be created by using the Effect class. The effect automatically subscribes to any signal and reruns when any of them change. So let's create an Effect that reruns whenever counter changes: Computed A computed signal is a signal that depends on other signals. To create a computed signal, you have to use the Computed class. A Computed automat","default_branch":null,"files":null,"tree":[],"storefront":"/r/nank1ro","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/nank1ro/solidart/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}