Skip to content

Instantly share code, notes, and snippets.

@markerikson
markerikson / redux-ajax-request-examples.js
Created January 1, 2017 20:30
Redux AJAX request examples
// Option 1: a thunk action creator using redux-thunk middleware
function myThunkActionCreator(someValue) {
return (dispatch, getState) => {
dispatch({type : "REQUEST_STARTED"});
myAjaxLib.post("/someEndpoint", {data : someValue})
.then(
// Use the (resolve, reject) form of .then() instead of .catch(),
// so that we don't accidentally dispatch REQUEST_FAILED on a reducer error
response => dispatch({type : "REQUEST_SUCCEEDED", payload : response}),
@datchley
datchley / react-redux-style-guide.md
Last active March 22, 2025 20:06
React + Redux Style Guide
@stevekinney
stevekinney / web-performance.md
Last active January 2, 2025 14:53
Web Performance Workshop

Web Performance

Requirements

Repositories