
Redux Saga API Abstraction. Avoid writing unnecessary boilerplate code. - tkay77
https://github.com/aruntk/redux-api-saga
======
tkay77
Takes in a config and gives you a ready to use reducer saga and a common
action.

Example code which makes an API call to
[http://localhost:3001/puppyJpg/20345?resolution=HD](http://localhost:3001/puppyJpg/20345?resolution=HD)

config --->

    
    
      {
        path: 'http://localhost:3001/puppyJpg/:imageId',
        method: 'GET',
        name: 'puppyJpg',
        mode: 'takeLatest',
        initialResult: '',
      },
    

Usage --->

    
    
        this.props.dispatch(action({
          name: 'puppyJpg',
          payload: {},
          params: { imageId: 20345 },
          query: { resolution: 'HD' },
          onSuccess: () => {},
          onError: (error) => {
            console.error(typeof error === 'string' ? error : error.message);
          };
        }));

