Skip to content

Commit ee30a87

Browse files
Use stable reference for getEntityActions action (#62536)
Co-authored-by: ntsekouras <ntsekouras@git.wordpress.org> Co-authored-by: youknowriad <youknowriad@git.wordpress.org>
1 parent fe8fe40 commit ee30a87

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed
Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
1+
/**
2+
* WordPress dependencies
3+
*/
4+
import type { Action } from '@wordpress/dataviews';
5+
16
/**
27
* Internal dependencies
38
*/
49
import type { State } from './reducer';
510

11+
const EMPTY_ARRAY: Action< any >[] = [];
12+
613
export function getEntityActions( state: State, kind: string, name: string ) {
7-
return state.actions[ kind ]?.[ name ] ?? [];
14+
return state.actions[ kind ]?.[ name ] ?? EMPTY_ARRAY;
815
}

0 commit comments

Comments
 (0)