Skip to content

Instantly share code, notes, and snippets.

@bonomiandreia
Last active March 13, 2023 22:22
Show Gist options
  • Save bonomiandreia/4feb6476247ae1940f11262943a2e53f to your computer and use it in GitHub Desktop.
Save bonomiandreia/4feb6476247ae1940f11262943a2e53f to your computer and use it in GitHub Desktop.
angular signals
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