Skip to content

Commit

Permalink
Use stable reference for getEntityActions action (WordPress#62536)
Browse files Browse the repository at this point in the history
Co-authored-by: ntsekouras <[email protected]>
Co-authored-by: youknowriad <[email protected]>
  • Loading branch information
3 people authored Jun 13, 2024
1 parent fe8fe40 commit ee30a87
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/editor/src/dataviews/store/private-selectors.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
/**
* WordPress dependencies
*/
import type { Action } from '@wordpress/dataviews';

/**
* Internal dependencies
*/
import type { State } from './reducer';

const EMPTY_ARRAY: Action< any >[] = [];

export function getEntityActions( state: State, kind: string, name: string ) {
return state.actions[ kind ]?.[ name ] ?? [];
return state.actions[ kind ]?.[ name ] ?? EMPTY_ARRAY;
}

0 comments on commit ee30a87

Please sign in to comment.