New:Microsoft Teams Notifications Are Now Available in Socket.Learn more →
Get Started

@elementor/query

Package Overview
Dependencies
Maintainers
7
Versions
1015
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@elementor/query

> **Warning** > > This package is under development and not ready for production use.

Source
npmnpm
Version
0.1.0
Version published
Weekly downloads
2.6K
-0.35%
Maintainers
7
Weekly downloads
 
Created
Source

Query

Warning

This package is under development and not ready for production use.

This package is a wrapper around react-query in order to easily expose it in the Editor.

For more information about react-query please refer to the official documentation.

Usage

import { createQueryClient, QueryClientProvider, useQuery } from '@elementor/query';

const queryClient = createQueryClient();

const App = () => (
	<QueryClientProvider client={ queryClient }>
		<MyComponent />
	</QueryClientProvider>
);

const MyComponent = () => {
	const { data: todos, isLoading } = useQuery( 'todos', () => fetch( /* ... */ ) );
	
	if ( isLoading ) {
		return <div>Loading...</div>;
	}
	
	return todos.map( /* ... */ );
};

FAQs

Package last updated on 28 Jun 2023

Related posts