Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
apollo-link-redux
Advanced tools
Changelog
0.2.1
Readme
Dispatches apollo-client 1.0-ish actions.
While there are still Apollo Client 1.0 applications out there in the wild, this provides a little shim to back fill redux actions previously dispatched in Apollo Client 1.0 as you migrate to Apollo Client 2.0. (This link is framework agnostic despite the reference to React migration docs).
apollo-link-redux is intended to compliment apps that also use redux. It is not encouraging that redux also manage application state of GraphQL query and mutation responses. That is a job done much better by an Apollo Client cache.
APOLLO_QUERY_INIT
APOLLO_QUERY_RESULT
APOLLO_MUTATION_INIT
APOLLO_MUTATION_RESULT
APOLLO_SUBSCRIPTION_INIT
APOLLO_SUBSCRIPTION_RESULT
All actions have operationName
, variables
and document
.
*_RESULT
actions will also contain result
.
npm i -S apollo-link-redux
(peer dependencies)
npm i -S apollo-link graphql
import { ApolloClient } from 'apollo-client';
import { ApolloLink } from 'apollo-link';
import ReduxLink from 'apollo-link-redux';
import { HttpLink } from 'apollo-link-http';
const link = ApolloLink.from([
new ReduxLink(store),
new HttpLink()
]);
const client = new ApolloClient({ link });
import { APOLLO_MUTATION_RESULT } from 'apollo-link-redux';
export function mutationFooCounter(state = {
count: 0
}, action) {
if (
action.operationName === 'MutateFoo' &&
action.type === APOLLO_MUTATION_RESULT
) {
const count = state.count + 1;
return { count };
}
return state;
}
npm test
FAQs
Dispatches apollo-client 1.0-ish actions.
The npm package apollo-link-redux receives a total of 90 weekly downloads. As such, apollo-link-redux popularity was classified as not popular.
We found that apollo-link-redux 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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.