Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export const saveNote = (noteId: string, content: string) => async (dispatch: Dispatch) => {
dispatch(StartLoading.create());
await refreshToken(dispatch);
try {
await NotesServiceProvider.get().updateNote(noteId, content);
dispatch(CompoundAction.create([
StopLoading.create(),
Actions.NoteSaved.create({ noteId, content }),
]));
} catch (e) {
handleError(dispatch, 'Error saving note.', e);
}
};