Last active
March 13, 2023 22:22
-
-
Save bonomiandreia/4feb6476247ae1940f11262943a2e53f to your computer and use it in GitHub Desktop.
angular signals
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Signals are a value that can be observed, I can call a method in the last item of an array, example. as rxjs, they can work like "follow" updates in variables, objects etc. | |
.set: set a new value for a variable and notify dependents. | |
.update: update a value based with a current value (number ) => number + 1 and return the new value | |
.mutate: catch the new value and updated it. its similar with update, the diference is .mutate doesn't return a value and mentains a history. | |
effect and computed: will receive a notify and do something about it | |
effect(() => console.log(we have ${number} dogs now! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment