wp.hooks.doAction( 'riff.app_view', detail, api )

Fires when a view of the Listen app shows: the first as the app starts, then each one in-page navigation brings, and again when one is drawn again in place. A plugin that added a view with the riff_app_views filter binds its script to what it drew here, or on the riff:app_view event, which bubbles to document.

Also dispatched as the riff:app_view event on #riff, with the same detail. The event bubbles.

Parameters

detailObject
The view.
  • viewstring
    Its slug: home, albums, album, post and the rest of Riff's, or the plugin's own.
  • panelHTMLElement
    The element the view is drawn in, [data-riff-app-view]; a plugin's is inside it, [data-riff-app-panel="<slug>"].
apiObject
window.riff.

More Information

Usage

wp.hooks.addAction( 'riff.app_view', 'my-plugin', ( detail, api ) => {
} );

// Or, without wp-hooks:
window.riff.on( 'app_view', ( detail ) => {} );

Source

emit( 'app_view', { view: detail.view, panel: detail.panel } );

Changelog

VersionDescription
6.4.0Introduced.