Hi,
can we add feature for adding custom methods that does not communicate with the server?
for example, right now. my work arround is to edit the feathers-redux and add something like this for me to achieve what i need.
custom/posts.js - for custom methods in post
import _ from 'lodash';
const SERVICES_POSTS_EDIT = 'SERVICES_POSTS_EDIT';
export default [
{
name: 'edit',
createAction: () => id => ({ id }),
reducer: { [SERVICES_POSTS_EDIT]: (state, action) => {
const postIndex = _.findIndex(state.queryResult.data, { id: action.payload.id });
const queryResult = state.queryResult;
queryResult.data[postIndex].isEditing = true;
return {
...state,
queryResult,
};
},
},
},
];
then in when reduxifying the services i added the custom methods
import posts from './custom/posts.js';
export const feathersServices = reduxifyServices(app, mapServicePathsToNames, {}, {
posts,
});
just to call something like this on my component
onEdit: (id) => {
dispatch(feathersServices.posts.edit(id));
},
maybe we can add some feature like this? not sure if good idea. but i think someone like me needed it.
Best Regards,
Jason Villalon