diff options
Diffstat (limited to 'docs/content/contributing/guidelines-frontend.en-us.md')
-rw-r--r-- | docs/content/contributing/guidelines-frontend.en-us.md | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/docs/content/contributing/guidelines-frontend.en-us.md b/docs/content/contributing/guidelines-frontend.en-us.md index dc9eef1303..921c2b0233 100644 --- a/docs/content/contributing/guidelines-frontend.en-us.md +++ b/docs/content/contributing/guidelines-frontend.en-us.md @@ -92,6 +92,12 @@ it's recommended to use `const _promise = asyncFoo()` to tell readers that this is done by purpose, we want to call the async function and ignore the Promise. Some lint rules and IDEs also have warnings if the returned Promise is not handled. +### Fetching data + +To fetch data, use the wrapper functions `GET`, `POST` etc. from `modules/fetch.js`. They +accept a `data` option for the content, will automatically set CSFR token and return a +Promise for a [Response](https://developer.mozilla.org/en-US/docs/Web/API/Response). + ### HTML Attributes and `dataset` The usage of `dataset` is forbidden, its camel-casing behaviour makes it hard to grep for attributes. |