Skip to content

Commit bbca371

Browse files
emmenkoacdlite
authored andcommitted
Still more JSDoc
1 parent 9de7b44 commit bbca371

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

src/utils/shallowEqual.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
/**
2+
* Given two objects, performs equality by iterating through keys
3+
* on an object and returning `false` when any key has values which
4+
* are not strictly equal between `objA` and `objB`.
5+
* Returns `true` when the values of all keys are strictly equal.
6+
*
7+
* @param {Object} objA
8+
* @param {Object} objB
9+
* @return {Boolean}
10+
*/
111
export default function shallowEqual(objA, objB) {
212
if (objA === objB) {
313
return true;

src/utils/shallowEqualScalar.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
/**
2+
* Given two objects, performs equality by iterating through keys
3+
* on an object and returning `false` when any key has values which
4+
* are not strictly equal between `objA` and `objB`.
5+
* Returns `true` when the values of all keys are strictly equal.
6+
*
7+
* NOTE: if value is an `Object`, returns `false`. This allows the check
8+
* to be more performant.
9+
*
10+
* @param {Object} objA
11+
* @param {Object} objB
12+
* @return {Boolean}
13+
*/
114
export default function shallowEqualScalar(objA, objB) {
215
if (objA === objB) {
316
return true;

0 commit comments

Comments
 (0)