mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
docs: use lighter lodash isEqual import in equality example
(cherry picked from commit 7d483f28a4)
This commit is contained in:
parent
f39896da99
commit
de5fbb7deb
1 changed files with 2 additions and 2 deletions
|
|
@ -237,9 +237,9 @@ When you read a signal within an `OnPush` component's template, Angular tracks t
|
|||
When creating a signal, you can optionally provide an equality function, which will be used to check whether the new value is actually different than the previous one.
|
||||
|
||||
```ts
|
||||
import _ from 'lodash';
|
||||
import isEqual from 'lodash/isEqual';
|
||||
|
||||
const data = signal(['test'], {equal: _.isEqual});
|
||||
const data = signal(['test'], {equal: isEqual});
|
||||
|
||||
// Even though this is a different array instance, the deep equality
|
||||
// function will consider the values to be equal, and the signal won't
|
||||
|
|
|
|||
Loading…
Reference in a new issue