Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
react-to-component
Advanced tools
Blazing fast library to componentify imperative or functional apis
:rocket: Blazing fast and tiny library that enables you to create react components (componentify) imperative or functional apis.
yarn add react-to-component
<ToComponent original={oldLegacyCodeApi} params={[1, 2, 3]}>
{({ loading, error, data }) =>
loading ? "Loading" : error ? "Oops, error" : JSON.stringify(data)
}
</ToComponent>
Prop | Required | Default | Type | Description |
---|---|---|---|---|
original | ✔️ | ✖️ | (...params: P[]) => Promise<T> or T | The original function to be encapsulated |
params | ✔️ | ✖️ | P[] | The params that will be used in the function invocation |
children | ✔️ | ✖️ | ({ data: T or null, error: Error or null, loading: boolean }) => JSX.Element or JSX.Element[] or null | The render prop that controls you data flow |
parametersDidChange | ✖️ | Params equality | (previousParams: P[], nextParams: P[]) => boolean | Ability to supply a custom check for parameter equality, use this if for example you need to ignore some parameters for caching purposes |
FAQs
Blazing fast library to componentify imperative or functional apis
The npm package react-to-component receives a total of 3 weekly downloads. As such, react-to-component popularity was classified as not popular.
We found that react-to-component 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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.