Skip to content

Instantly share code, notes, and snippets.

@viniciusdacal
Last active August 18, 2017 13:03
Show Gist options
  • Select an option

  • Save viniciusdacal/b2c9c25b2f4c2116d577f22df0a5bac2 to your computer and use it in GitHub Desktop.

Select an option

Save viniciusdacal/b2c9c25b2f4c2116d577f22df0a5bac2 to your computer and use it in GitHub Desktop.
import { createApiActions } from 'redux-arc';
import './createOrUpdate';
const { creators, types } = createApiActions('todo', {
save: {
url: 'path/to/to-do',
method: 'post',
policies: ['createOrUpdate'],
},
});
creators.save({
payload: {
description: 'New post about ARC',
date: '2017-08-09',
}
});
creators.save({
payload: {
id: 1
description: 'Update post about ARC',
date: '2017-08-09',
},
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment