import * as types from "./actionTypes"; import api from "./api"; import { sendHttpRequest } from "../../redux/actions/httpActions"; export function loadReleaseNotes() { return async function (dispatch, getState) { try { const notes = getState().releaseNotes; if (notes && (notes.loading || notes.loaded)) return; dispatch({ type: types.LOAD_RELEASE_NOTES_STARTED }); const data = await dispatch(sendHttpRequest(api.getReleaseNotes())); dispatch({ type: types.LOAD_RELEASE_NOTES_SUCCESS, payload: data }); } catch (error) { throw error; } }; }