
Security News
MCP Community Begins Work on Official MCP Metaregistry
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.
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.
The npm package apollo-prefetch receives a total of 2 weekly downloads. As such, apollo-prefetch popularity was classified as not popular.
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.
Security News
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.
Research
Security News
Socket uncovers an npm Trojan stealing crypto wallets and BullX credentials via obfuscated code and Telegram exfiltration.
Research
Security News
Malicious npm packages posing as developer tools target macOS Cursor IDE users, stealing credentials and modifying files to gain persistent backdoor access.