How to use the redoodle.CompoundAction.create function in redoodle

To help you get started, we’ve selected a few redoodle examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github fawind / notes / app / src / store / actions / notesAsync.ts View on Github external
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);
  }
};