Skip to content

Latest commit

 

History

History
29 lines (20 loc) · 498 Bytes

util.md

File metadata and controls

29 lines (20 loc) · 498 Bytes

Utility

To generate a utility file, run

redux g util <name> [util1] [util2] ...

For example:

redux g util api fetchUsers getData

Do not include _util.js as part of the name

This will create a file frontend/util/api_util.js:

export const fetchUsers = users => (
  $.ajax({
    method: '',
    url: '',
    data: ''
  })
);

export const getData = () => (
  // your code here
);

Having the word fetch in the utils will automatically create a blank ajax request.