Last active
February 16, 2020 11:56
Gist for my "WordPress: Laravel Mix, Sass and ES6 Modules in theme development" tutorial at https://since1979.dev/wordpress-laravel-mix-sass-and-es6-modules-in-theme-development/
This file contains hidden or 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
var Example = { | |
settings: { | |
setting: 'Initial value' | |
}, | |
init: function( options ) { | |
// Do some init stuff like process settings. | |
this.settings.setting = options.setting; | |
// Run your custom code. | |
this.startRunningYourCode() | |
}, | |
startRunningYourCode: function() { | |
// Your custom code goes here. | |
console.log( this.settings.setting ); | |
} | |
} | |
export default Example; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment