Advertisement
Guest User

Untitled

a guest
Jan 20th, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. import actions from "./actions";
  2.  
  3. // This is a link to an action defined in actions.js.
  4. const simpleQuack = actions.quack;
  5.  
  6. // This is a thunk which dispatches multiple actions from actions.js
  7. const complexQuack = ( distance ) => ( dispatch ) => {
  8. dispatch( actions.quack( ) ).then( ( ) => {
  9. dispatch( actions.swim( distance ) );
  10. dispatch( /* any action */ );
  11. } );
  12. }
  13.  
  14. export default {
  15. simpleQuack,
  16. complexQuack
  17. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement