Skip to content

Instantly share code, notes, and snippets.

@vanaf1979
Last active February 16, 2020 11:56
Show Gist options
  • Save vanaf1979/5761c393475b564e2ed1a3b29e9cdac9 to your computer and use it in GitHub Desktop.
Save vanaf1979/5761c393475b564e2ed1a3b29e9cdac9 to your computer and use it in GitHub Desktop.
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/
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