
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
Easycall is your go-to solution for managing API interactions in React applications. It's designed from the ground up to ensure that every API call is streamlined, efficient, and intuitive. With Easycall, state management becomes second nature, and API calls feel like an integral part of your component tree.
Initiate your Easycall experience with a simple installation:
npm install easycall --save
Set the stage by configuring endpoints and methods tailored to your application's requirements:
import { CallerProvider } from "easycall"
ReactDOM.createRoot(document.getElementById("root")!).render(
<CallerProvider
easycallConfig={{
baseURL: "https://jsonplaceholder.typicode.com/",
headers: {
"Content-type": "application/json; charset=UTF-8",
},
apiRoutes: [
{
key: "todos",
method: "get",
endpoint: "todos",
},
{
key: "todo",
method: "get",
endpoint: "todos/{0}",
},
],
onBeforeRequest: (config) => {
const token = localStorage.getItem("token")
config.headers = token
? {
...config.headers,
Authorization: `Bearer ${token}`,
}
: config.headers
return config
},
onAfterResponse: (response) => {
console.log("onAfterResponse", response)
return response
},
}}
>
<App />
</CallerProvider>,
)
Harness the useCaller hook to make your API interactions intuitive while enabling precise argument passing and query string manipulations:
import { useCaller } from "easycall"
function SampleComponent() {
const { call, data, error, loading } = useCaller((caller) => caller?.todos?.get?.())
return loading ? (
<LoadingComponent />
) : (
<>
{error && <ErrorAlert message={error.message} />}
{data && <DataViewer data={data} />}
</>
)
}
Envision fetching a specific todo item using an identifier like id. Easycall makes this easy by dynamically replacing endpoint placeholders:
import { useCaller } from "easycall"
export const DetailedComponent = () => {
const { call, data, error, loading } = useCaller((caller) =>
caller.todo.get({
args: ["id"],
queryString: "?numberOfItems=10",
}),
)
return loading ? (
<LoadingComponent />
) : (
<>
{error && <ErrorAlert message={error.message} />}
{data && <DataViewer data={data} />}
</>
)
}
Easycall's useCaller hook is brilliantly reactive. It re-invokes the API call whenever a dependency changes, guaranteeing that your components are always in sync with the freshest data:
import { useState } from "react"
import { useCaller } from "easycall"
function DynamicComponent() {
const [toggle, setToggle] = useState(false)
const { call, data, error, loading } = useCaller((caller) => caller?.todos?.get?.(), {
dependencies: [toggle],
})
return loading ? (
<LoadingComponent />
) : (
<>
{error && <ErrorAlert message={error.message} />}
{data && <DataViewer data={data} />}
<button onClick={() => setToggle((prev) => !prev)}>Toggle Status</button>
</>
)
}
For enthusiasts who prefer an intricate touch, delve into a detailed strategy:
const apiRoutes: ApiRoute[] = [{ endpoint: "/todo", methods: ["Get", "Post"] }];
const callerInstance = createCaller(apiRoutes);
export callerInstance;
Note: Opting for this method means you forgo the luxuries of the
useCallerhook and the context store provided by<CallerProvider />.
Stay connected for future updates!
Easycall thrives on community insights. Whether it's identifying bugs, brainstorming features, or enhancing the codebase, your input is invaluable:
FAQs
easyapi, is a framework to call api and store results painlessly.
The npm package easycall receives a total of 1 weekly downloads. As such, easycall popularity was classified as not popular.
We found that easycall demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.