React Context API Provider for handling game data
npm install spa-api-providerA React Context API provider for managing game data and configurations.
Install the package using npm:
``sh`
npm install spa-api-provider
`tsx
import React from 'react';
import { ApiProvider } from 'spa-api-provider';
const App = () => {
return (
//
);
};
export default App;
`
`tsx
import { useApi } from 'spa-api-provider';
const YourComponent = () => {
const { getGameScores, saveGameScore } = useApi();
const fetchScores = async () => {
const scores = await getGameScores();
console.log(scores);
};
return (