@miii/turbo-multiple-frame-targeting
v1.0.2
Published
Add support for multiple frame targeting in Turbo
Downloads
40
Maintainers
Readme
@miii/turbo-multiple-frame-targeting
Add support for multiple frame targeting in Turbo
💡 Motivation
See hotwired/turbo#475 and hotwired/turbo#56. This is an alternative solution to implementing Turbo streams in situations where refactoring otherwise may be required.
📦 Setup
$ npm install @miii/turbo-multiple-frame-targeting
import * as Turbo from '@hotwired/turbo'
import enableMultiFrameSupport from '@miii/turbo-multiple-frame-targeting'
Turbo.start()
enableMultiFrameSupport()
Alternative setup
import * as Turbo from '@hotwired/turbo'
import { enable, disable } from '@miii/turbo-multiple-frame-targeting'
Turbo.start()
enable()
// Later...
disable()
🚀 Usage
This package will enable you to provide a space-separated list of identifiers, much like Stimulus.
<form data-turbo-frame="row_21 sidebar">
...
</form>
<a data-turbo-frame="row_21 sidebar">
...
</a>