
Product
Introducing Webhook Events for Pull Request Scans
Add real-time Socket webhook events to your workflows to automatically receive pull request scan results and security alerts in real time.
apollo-prefetch
Advanced tools
Middleware, HOC, & utilities to prefetch view data in React + React-Router + Apollo projects.
Notice: this library has been used succesfully in production, but probably don't use it. It's here for reference, but I won't be putting more work into it.
For a more generic solution that will work with react-router
v4, try react-hydrate
.
Async middleware and utilities for prefetching data in React + React-Router + Apollo projects.
Inspired by AsyncProps and next.js.
npm i apollo-prefetch --save
Add asyncMiddleware
to your router instance:
import React from 'react'
import { Router, browserHistory, match, RouterContext } from 'react-router'
import routes from './routes'
import { store, client } from './store'
import { asyncMiddleware } from 'apollo-prefetch'
const Root = props => (
<ApolloProvider client={client} store={store}>
<Router
history={browserHistory}
routes={routes}
render={asyncMiddleware({
routes,
client,
store,
onLoad: () => console.log('Loading...'),
onComplete: () => console.log('Load Complete'),
})}
{...props.renderProps}/>
</ApolloProvider>
)
match({ browserHistory, routes }, (error, redirectLocation, renderProps) => {
if (error) throw new Error(error)
render(<Root renderProps={renderProps}/>, document.getElementById('root'))
})
MIT
FAQs
Middleware, HOC, & utilities to prefetch view data in React + React-Router + Apollo projects.
We found that apollo-prefetch 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.
Product
Add real-time Socket webhook events to your workflows to automatically receive pull request scan results and security alerts in real time.
Research
The Socket Threat Research Team uncovered malicious NuGet packages typosquatting the popular Nethereum project to steal wallet keys.
Product
A single platform for static analysis, secrets detection, container scanning, and CVE checks—built on trusted open source tools, ready to run out of the box.