Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2019
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. cd src/app/state/ducks
  4.  
  5. mkdir $1
  6.  
  7. cd $1
  8.  
  9. printf "
  10. import axios from 'axios';
  11. import actions from './actions';
  12.  
  13.  
  14.  
  15. export default {
  16. };" > operations.js
  17.  
  18. printf "
  19. import types from './types';
  20.  
  21. const = (payload) => ({
  22. type: ,
  23. payload,
  24. });
  25.  
  26.  
  27. export default {
  28.  
  29. };" > actions.js
  30.  
  31. printf "
  32. import { combineReducers } from 'redux';
  33. import cloneDeep from 'lodash/cloneDeep';
  34. import types from './types';
  35. import operations from './operations';
  36. import actions from './actions';
  37.  
  38. const = (state = null, { type, payload }) => {
  39. let newState = cloneDeep(state);
  40.  
  41. switch (type) {
  42. case :
  43.  
  44. break;
  45.  
  46. default:
  47. break;
  48. }
  49.  
  50. return newState;
  51. };
  52.  
  53. export default combineReducers({
  54. });" > reducers.js
  55.  
  56. printf "
  57.  
  58. export default {
  59.  
  60. };" > types.js
  61.  
  62. printf "
  63. import reducers from './reducers';
  64.  
  65. export { default as operations } from './operations';
  66. export { default as types } from './types';
  67.  
  68. export default reducers;" > index.js
  69.  
  70. cd ../
  71.  
  72. pwd
  73.  
  74. printf "export { default as $1 } from './$1/index';\n" >> ./index.js
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement