
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
@spinamp/spinamp-hooks
Advanced tools
Set of react hooks for fetching data from spinamp pipeline built on top of react-query and spinamp-sdk.
Spinamp-Hooks is a set of react hooks for fetching data from Spindex, Spinamp's growing index of the growing web3 music ecosystem. It provides hooks for music nft activity, music content, metadata and playlists.
It is built on top of react-query and spinamp-sdk. It gives quick and easy access to data and handles all loading & refetching with the power of react-query.
The package can be installed using yarn or npm:
yarn add @spinamp/spinamp-hooks
or
npm i @spinamp/spinamp-hooks
The only thing required to make the lib work is to wrap whole app with the SpinampProvider component. Once it's done, all hooks can be used in all children components:
import {SpinampProvider, useAllTracksQuery} from "@spinamp/spinamp-hooks";
function App() {
return (
// Wrap whole app with the SpinampProvider
<SpinampProvider>
<TracksList />
</SpinampProvider>
)
}
function TracksList() {
const {tracks, isLoading, isError, refetch} = useAllTracksQuery();
if (isLoading) {
return <p>Loading!</p>;
}
if (isError) {
return (
<div>
<p>Ups! Something went wrong</p>
<button onPress={() => refetch()}>Try again</button>
</div>
);
}
return (
<div>
<p>All tracks list!</p>
<ul>
{tracks.map(track => (
<li key={track.id}>{track.title}</li>
))}
</ul>
</div>
);
}
render(<App />, document.getElementById('root'));
For further usage examples and comprehensive API Reference, see the documentation.
FAQs
Set of react hooks for fetching data from spinamp pipeline built on top of react-query and spinamp-sdk.
We found that @spinamp/spinamp-hooks demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
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.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.