
Security News
Crates.io Users Targeted by Phishing Emails
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
redux-resx-feathers-middleware
Advanced tools
Middleware for redux-resx using
feathers-client
.
npm install --save redux-resx-feathers-middleware
import resxMiddleware from 'redux-resx-feathers-middleware';
import feathers from 'feathers-client';
import rest from 'feathers-client/rest';
import reducers from './reducers';
// Setup your feathers app - probably in a different file
const app = feathers().configure(rest('/api').fetch(fetch));
export default function createAppStore() {
return createStore(
reducers,
compose(
applyMiddleware(
resxMiddleware(app)
),
window.devToolsExtension ? window.devToolsExtension() : (f) => f
)
);
}
Not yet - all we'd need to add is websocket events handlers that fire receiver actions
WARNING: This API may change. I'd like feedback on it :)
Pagination is handled by installing a resultReducer
on your resource.
import pagination from 'redux-resx-feathers-middleware';
const paginate = pagination({ perPage: 10 });
export const users = createResource({
name: '@resx/USER',
url: '/users',
// Add this to paginated endpoints
resultReducers: {
find: paginate,
},
});
This will add a pagination
object to your resource state:
Here is an exmaple when using it in a component:
import React, { PropTypes } from 'react';
import { bindActionCreators } from 'redux';
import { connect } from 'react-redux';
import { users } from '../../resources';
export const UsersPage = React.createClass({
displayName: 'UsersPage',
propTypes: {
findUsers: PropTypes.func.isRequired,
dispatch: PropTypes.func.isRequired,
users: PropTypes.object.isRequired,
},
componentWillMount() {
const { findUsers } = this.props;
findUsers({ query: { roles: 'admin' } });
},
render() {
const { users: { items, pagination }, dispatch } = this.props;
// *** Important bit here **
// Dispatch pagination.next to fetch the next items.
// The result of this call will be concatenated onto items.
const next = () => dispatch(pagination.next);
return (
<div>
<h1>Emails:</h1>
{JSON.stringify(items.map(i => i.email))}
{pagination ? <button disabled={!pagination.hasMore} onClick={next}>Next</button> : null}
</div>
);
},
});
function mapStateToProps(state) {
return {
users: users.selector(state),
};
}
const { find: findUsers } = users.actions;
export default connect(mapStateToProps, {
findUsers,
})(UsersPage);
FAQs
Feathers middleware for redux-resx
We found that redux-resx-feathers-middleware 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 Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
Product
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.