Skip to content

Commit

Permalink
Rename convertBlockToReusable to convertBlocksToReusable and update t…
Browse files Browse the repository at this point in the history
…he README
  • Loading branch information
adamziel committed Oct 8, 2020
1 parent e15be51 commit de23117
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 13 deletions.
9 changes: 4 additions & 5 deletions packages/reusable-blocks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,10 @@ The most basic usage of this package would involve only telling the `<BlockEdito

```js
const { __experimentalReusableBlocks } = useSelect(
( select ) => ( {
__experimentalReusableBlocks: select(
'core/reusable-blocks'
).__experimentalGetReusableBlocks(),
} )
( select ) => select( 'core' ).getEntityRecords(
'postType',
'wp_block',
)
);

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export default function ReusableBlockConvertButton( { clientIds } ) {
);

const {
__experimentalConvertBlockToReusable: convertBlockToReusable,
__experimentalConvertBlocksToReusable: convertBlocksToReusable,
} = useDispatch( STORE_KEY );

if ( ! canConvert ) {
Expand All @@ -77,7 +77,7 @@ export default function ReusableBlockConvertButton( { clientIds } ) {
<MenuItem
icon={ reusableBlock }
onClick={ () => {
convertBlockToReusable( clientIds );
convertBlocksToReusable( clientIds );
onClose();
} }
>
Expand Down
6 changes: 3 additions & 3 deletions packages/reusable-blocks/src/store/actions.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* Internal dependencies
*/
import { convertBlockToStatic, convertBlockToReusable } from './controls';
import { convertBlockToStatic, convertBlocksToReusable } from './controls';

/**
* Returns a generator converting a reusable block into a static block.
Expand All @@ -17,6 +17,6 @@ export function* __experimentalConvertBlockToStatic( clientId ) {
*
* @param {string} clientIds The client IDs of the block to detach.
*/
export function* __experimentalConvertBlockToReusable( clientIds ) {
yield convertBlockToReusable( clientIds );
export function* __experimentalConvertBlocksToReusable( clientIds ) {
yield convertBlocksToReusable( clientIds );
}
6 changes: 3 additions & 3 deletions packages/reusable-blocks/src/store/controls.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ export function convertBlockToStatic( clientId ) {
* @param {Array} clientIds Block IDs.
* @return {Object} control descriptor.
*/
export function convertBlockToReusable( clientIds ) {
export function convertBlocksToReusable( clientIds ) {
return {
type: 'CONVERT_BLOCK_TO_REUSABLE',
type: 'CONVERT_BLOCKS_TO_REUSABLE',
clientIds,
};
}
Expand All @@ -52,7 +52,7 @@ const controls = {
}
),

CONVERT_BLOCK_TO_REUSABLE: createRegistryControl(
CONVERT_BLOCKS_TO_REUSABLE: createRegistryControl(
( registry ) =>
async function ( { clientIds } ) {
const reusableBlock = {
Expand Down

0 comments on commit de23117

Please sign in to comment.