Skip to content

Commit e94320d

Browse files
authored
Merge pull request #1081 from elliotwaite/elliotwaite-patch-1
Fix web version to skip notifying listeners if the value has not changed
2 parents 90db9fc + 8150883 commit e94320d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

package/src/values/web/RNSkReadonlyValue.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@ export class RNSkReadonlyValue<T> implements SkiaValue<T> {
1313
}
1414

1515
protected update(nextValue: T): void {
16-
this._current = nextValue;
17-
this.notifyListeners();
16+
if (this._current !== nextValue) {
17+
this._current = nextValue;
18+
this.notifyListeners();
19+
}
1820
}
1921

2022
public readonly __typename__ = "RNSkValue";

0 commit comments

Comments
 (0)