Last active
June 14, 2017 20:15
-
-
Save illepic/db142444a5681bd2f6993f428a7c48c2 to your computer and use it in GitHub Desktop.
ES6 modules with Drupal implementation (pseudocode)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { slick } from 'slick'; | |
import { jQuery as $ } from 'jquery'; | |
export default function(context) { | |
// jquery plugins not this easy in reality, tbd | |
$('.carousel-thingy', context).slick(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Drupal } from 'Drupal'; | |
import carousel from './carousel'; | |
export default function() { | |
Drupal.behaviors.carousel = { | |
attach(context) { | |
carousel(context); | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import carousel from './carsousel'; | |
carousel(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment