1.1.2 • Published 4 years ago

redux-feathers v1.1.2

Weekly downloads
3
License
MIT
Repository
github
Last release
4 years ago

redux-feathers

Wrap Feathers services to use them as redux actions and put their result into the state.

This package directly depends on redux-saga-wrapper.

Installation

npm i redux-saga-wrapper redux-feathers --save
# or
yarn add redux-saga-wrapper redux-feathers

How to use

Register Feathers actions:

import { createStore } from 'redux-saga-wrapper';
import { createFeathersActions } from 'redux-feathers';

const feathersClient = feathers();

const onFeathersError = console.error;
const actions = createFeathersActions(feathersClient, onFeathersError);

const store = createStore({}, actions);

// ... use store as usual

Use Feathers in your components:

import { mapDispatchToProps } from 'redux-feathers';

class App extends React.Component {

  // ...

  componentDidMount() {
    this.props.service('users').find({ $limit: 10 });
  }

  // ...
}

const mapStateToProps = state => ({
  users: users && users.list,
});

export default connect(mapStateToProps, mapDispatchToProps)(App);
1.1.2

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.0

4 years ago

0.2.0

4 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago