@cloudscape-design/collection-hooks
Advanced tools
Comparing version
@@ -18,9 +18,4 @@ "use strict"; | ||
}); | ||
return [ | ||
state, | ||
(0, utils_js_1.createActions)({ | ||
dispatch, | ||
collectionRef, | ||
}), | ||
]; | ||
const actions = (0, react_1.useMemo)(() => (0, utils_js_1.createActions)({ dispatch, collectionRef }), [dispatch, collectionRef]); | ||
return [state, actions]; | ||
} |
{ | ||
"commit": "60a26d1f95d7fd2e06e285bfa4230e328c3dcade" | ||
"commit": "6d79b19d33bed5ffe1375389460c5cd8d33ed626" | ||
} |
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
import { useReducer } from 'react'; | ||
import { useReducer, useMemo } from 'react'; | ||
import { createActions, collectionReducer } from './utils.js'; | ||
@@ -15,9 +15,4 @@ export function useCollectionState(options, collectionRef) { | ||
}); | ||
return [ | ||
state, | ||
createActions({ | ||
dispatch, | ||
collectionRef, | ||
}), | ||
]; | ||
const actions = useMemo(() => createActions({ dispatch, collectionRef }), [dispatch, collectionRef]); | ||
return [state, actions]; | ||
} |
{ | ||
"name": "@cloudscape-design/collection-hooks", | ||
"version": "1.0.66", | ||
"version": "1.0.67", | ||
"license": "Apache-2.0", | ||
@@ -5,0 +5,0 @@ "repository": { |
106335
0.05%2108
-0.47%