Gathering detailed insights and metrics for redux-resx-feathers-middleware
Gathering detailed insights and metrics for redux-resx-feathers-middleware
Gathering detailed insights and metrics for redux-resx-feathers-middleware
Gathering detailed insights and metrics for redux-resx-feathers-middleware
npm install redux-resx-feathers-middleware
Typescript
Module System
Node Version
NPM Version
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
1 Stars
17 Commits
2 Watchers
1 Branches
1 Contributors
Updated on Sep 20, 2017
Latest Version
0.3.0
Package Id
redux-resx-feathers-middleware@0.3.0
Size
20.53 kB
NPM Version
5.4.2
Node Version
6.3.1
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
1
4
Middleware for redux-resx using
feathers-client
.
1npm install --save redux-resx-feathers-middleware
1import resxMiddleware from 'redux-resx-feathers-middleware'; 2 3import feathers from 'feathers-client'; 4import rest from 'feathers-client/rest'; 5 6import reducers from './reducers'; 7 8// Setup your feathers app - probably in a different file 9const app = feathers().configure(rest('/api').fetch(fetch)); 10 11export default function createAppStore() { 12 return createStore( 13 reducers, 14 compose( 15 applyMiddleware( 16 resxMiddleware(app) 17 ), 18 window.devToolsExtension ? window.devToolsExtension() : (f) => f 19 ) 20 ); 21}
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.
1import pagination from 'redux-resx-feathers-middleware'; 2 3const paginate = pagination({ perPage: 10 }); 4export const users = createResource({ 5 name: '@resx/USER', 6 url: '/users', 7 // Add this to paginated endpoints 8 resultReducers: { 9 find: paginate, 10 }, 11});
This will add a pagination
object to your resource state:
Here is an exmaple when using it in a component:
1import React, { PropTypes } from 'react'; 2import { bindActionCreators } from 'redux'; 3import { connect } from 'react-redux'; 4 5import { users } from '../../resources'; 6 7export const UsersPage = React.createClass({ 8 displayName: 'UsersPage', 9 10 propTypes: { 11 findUsers: PropTypes.func.isRequired, 12 dispatch: PropTypes.func.isRequired, 13 users: PropTypes.object.isRequired, 14 }, 15 16 componentWillMount() { 17 const { findUsers } = this.props; 18 findUsers({ query: { roles: 'admin' } }); 19 }, 20 21 render() { 22 const { users: { items, pagination }, dispatch } = this.props; 23 24 // *** Important bit here ** 25 // Dispatch pagination.next to fetch the next items. 26 // The result of this call will be concatenated onto items. 27 const next = () => dispatch(pagination.next); 28 return ( 29 <div> 30 <h1>Emails:</h1> 31 {JSON.stringify(items.map(i => i.email))} 32 {pagination ? <button disabled={!pagination.hasMore} onClick={next}>Next</button> : null} 33 </div> 34 ); 35 }, 36}); 37 38function mapStateToProps(state) { 39 return { 40 users: users.selector(state), 41 }; 42} 43 44const { find: findUsers } = users.actions; 45 46export default connect(mapStateToProps, { 47 findUsers, 48})(UsersPage);
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no SAST tool detected
Details
Reason
Found 0/17 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
license file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
45 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More