How to use the @webiny/plugins.unregisterPlugin function in @webiny/plugins

To help you get started, we’ve selected a few @webiny/plugins 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 webiny / webiny-js / packages / app-page-builder / src / editor / plugins / blockEditing / SearchBlocks.js View on Github external
const deleteBlock = useCallback(async ({ plugin, deleteElement }) => {
        const response = await deleteElement({
            variables: {
                id: plugin.id
            }
        });

        const { error } = response.data.pageBuilder.deleteElement;
        if (error) {
            showSnackbar(error.message);
            return;
        }

        unregisterPlugin(plugin.name);
        showSnackbar("Block " + plugin.title + " successfully deleted.");
    }, []);
github webiny / webiny-js / packages / app-page-builder / src / admin / utils / components / Title.js View on Github external
showConfirmation(async () => {
                                    const { plugin, refresh, id } = props;
                                    const { data: res } = await client.mutate({
                                        mutation: deleteElement,
                                        variables: { id }
                                    });

                                    const { error } = res.pageBuilder.deleteElement;
                                    if (error) {
                                        return showSnackbar(error.message);
                                    }

                                    unregisterPlugin(plugin);

                                    refresh();

                                    showSnackbar(
                                        <span>
                                            Element <strong>{title}</strong> deleted!
                                        </span>
                                    );
                                })
                            }

@webiny/plugins

A simple registry that stores all plugins in a shared object.

MIT
Latest version published 21 days ago

Package Health Score

86 / 100
Full package analysis

Similar packages