Issue #2152💬 AnsweredOpened July 19, 2019by csb3461 reactions

How to distinguish between a successful or invalid store?

Quick answerby artf1

@csb346 yes, you're right, there is no storage:success:store, the event storage:end:store is correctly called even in case of errors, but being the last called you can make use of a flag variable

Read full answer below ↓

Question

Hi! I'm integrating GrapesJS ina laravel app and so far so good. After configuring remote load and storage, I'm trying to show a notification after any store (auto or manual). Following the API documentation I got that easily: editor.on('storage:end:store', () => { showNotification() }); This works fine. Then I tried to show a different notification in case of a remote error like this: editor.on('storage:error:store', () => { showErrorNotification() }); It's working, but in case of an error it shows both the notifications. I think there is no storage:success:store event. Is there any way to a...

Answers (1)

artfJuly 31, 2019

@csb346 yes, you're right, there is no storage:success:store, the event storage:end:store is correctly called even in case of errors, but being the last called you can make use of a flag variable

Related Questions and Answers

Continue research with similar issue discussions.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Free option

Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.

Browse free plugins →
Premium option

Premium plugins ship with support, regular updates, and production-ready features — save days of integration work.

Browse premium plugins →

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.