mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
docs: use lighter lodash isEqual import in equality example
(cherry picked from commit 7d483f28a4)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user