Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@elementor/query

Package Overview
Dependencies
Maintainers
7
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@elementor/query

Wrapper around `@tanstack/react-query`

  • 0.2.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
953
decreased by-26.3%
Maintainers
7
Weekly downloads
 
Created
Source

Query

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

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

[!WARNING] Please refrain from accessing or depending on functions and variables starting with double underscores, as they are subject to change without notice. Naming convention involving double underscores (__) as a prefix to indicate that a function or variable is meant for internal use and should not be accessed or relied upon by third-party developers.

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( {
		queryKey: 'todos',
		queryFn: () => fetch( '/todos' ).then( ( res ) => res.json() ),
	} );
	
	if ( isLoading ) {
		return <div>Loading...</div>;
	}
	
	return todos.map( /* ... */ );
};

FAQs

Package last updated on 11 Dec 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc