-
Notifications
You must be signed in to change notification settings - Fork 81
Reusable actions
amplifi edited this page Jun 29, 2017
·
1 revision
These actions can be use throughout the client implementation.
REQUEST_START
and REQUEST_DONE
should be dispatched whenever an asynchronous request is started or finished. The client application will the display a loading status to the user.
Example use, within an asychronous action:
import Request from '/src/request';
import {requestStart, requestDone} from '/src/actions/router'
export function accountLogout() {
return dispatch => {
dispatch(requestStart());
return Request.post('/account/logout/')
.then(
(success => {
dispatch(postLogoutSuccess(success));
dispatch(requestDone());
}),
(error => {
dispatch(postLogoutError(error));
dispatch(requestDone());
})
)
}
}
Visit our User Documentation to learn more about using the Cadasta Platform.
If you'd like to contribute to the Cadasta Platform, start with our Contributing Guidelines.
Cadasta Wiki Home | Developer Setup Guide
Cadasta.org | About Cadasta | YouTube | Twitter | Facebook
- Installing & Running
- Contributing
- Planning & Sprints
- Platform Development
- Testing
- Utilities
- Outreachy
- Platform Site Map
- User Flows and Wireframes
- Other
- Quick Start Guide
- Glossary
- Questionnaire Guide