/
githubmirror
/
gutenberg
Обзор
Документация
Войти
/
githubmirror
/
gutenberg
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
trunk
packages/e2e-tests/plugins/interactive-blocks/router-script-modules-wrapper/view.js
29 строк
677 B
Marco Ciampini
ESLint: Replace strict config with bulk suppressions (#81248)
07 авг 2026, 14:34
Не верифицирован
07 авг 2026, 14:34
7f43eaf
Код
Авторство
О чём код?
import { store, getElement } from '@wordpress/interactivity'; const { state } = store( 'test/router-script-modules', { state: { clientSideNavigation: false, names: [], }, actions: { *navigate( e ) { e.preventDefault(); state.clientSideNavigation = false; const { actions } = yield import( '@wordpress/interactivity-router' ); yield actions.navigate( e.target.href ); state.clientSideNavigation = true; }, *prefetch() { const { ref } = getElement(); const { actions } = yield import( '@wordpress/interactivity-router' ); yield actions.prefetch( ref.href ); }, pushName( name ) { state.names.push( name ); }, }, } );