Commit Graph

1 Commits

Author SHA1 Message Date
Albert Juhé Lluveras ff9c73bec5 Implement memoization in several selectors and hooks (https://github.com/woocommerce/woocommerce-blocks/pull/4548)
* Memoize cartErrors from useStoreCart

* Implement memoization to other selectors

* Use EMPTY_ARRAY in more cases

* Create getArrayOrEmptyConstant function

* Remove DEFAULT_EMPTY_ARRAY constant and use EMPTY_ARRAY instead

* Wrap removeItem into useCallback

* Fix tests

* Do not default to empty array/object for values that should exist and use different constant for empty values

* Type two empty array constants from default-states.ts
2021-08-13 15:28:41 +02:00