How to use the @wordpress/compose.withSafeTimeout function in @wordpress/compose

To help you get started, we’ve selected a few @wordpress/compose examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github WordPress / gutenberg / packages / components / src / form-token-field / suggestions-list.js View on Github external
/* eslint-enable jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events */
					} )
				}
			
		);
	}
}

SuggestionsList.defaultProps = {
	match: '',
	onHover: () => {},
	onSelect: () => {},
	suggestions: Object.freeze( [] ),
};

export default withSafeTimeout( SuggestionsList );
github WordPress / gutenberg / packages / components / src / draggable / index.js View on Github external
// Reset cursor.
		document.body.classList.remove( 'is-dragging-components-draggable' );
	}

	render() {
		const { children } = this.props;

		return children( {
			onDraggableStart: this.onDragStart,
			onDraggableEnd: this.onDragEnd,
		} );
	}
}

export default withSafeTimeout( Draggable );
github WordPress / gutenberg / packages / block-library / src / footnotes / edit.js View on Github external
text: value,
											};
										} ),
									} );
								} }
								placeholder={ __( 'Footnote' ) }
							/>
						
					
				) }
			
		
	);
}

export default withSafeTimeout( Edit );
github ampproject / amp-wp / assets / src / stories-editor / components / block-mover / draggable.js View on Github external
transferData: PropTypes.shape( {
		type: PropTypes.string,
		srcIndex: PropTypes.number,
		srcRootClientId: PropTypes.string,
		srcClientId: PropTypes.string,
	} ),
	onDragStart: PropTypes.func,
	onDragEnd: PropTypes.func,
	clearHighlight: PropTypes.func.isRequired,
	setHighlightByOffset: PropTypes.func.isRequired,
	dropElementByOffset: PropTypes.func.isRequired,
	setTimeout: PropTypes.func.isRequired,
	children: PropTypes.func.isRequired,
};

export default withSafeTimeout( Draggable );
github ampproject / amp-wp / assets / src / stories-editor / components / template-inserter / template-preview.js View on Github external
return (
		
	);
};

TemplatePreview.propTypes = {
	item: PropTypes.shape( {
		id: PropTypes.number.isRequired,
	} ).isRequired,
	setTimeout: PropTypes.func.isRequired,
};

export default withSafeTimeout( TemplatePreview );