Skip to content

💎 Add support for multiple frame targeting in Turbo. Alternative solution to implementing Turbo streams in situations where refactoring otherwise may be required.

Notifications You must be signed in to change notification settings

miii/turbo-multiple-frame-targeting

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@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>

About

💎 Add support for multiple frame targeting in Turbo. Alternative solution to implementing Turbo streams in situations where refactoring otherwise may be required.

Topics

Resources

Stars

Watchers

Forks