Skip to content

Instantly share code, notes, and snippets.

@vjpr
Created July 25, 2015 06:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vjpr/16b6e1ec8deb8c24c5a2 to your computer and use it in GitHub Desktop.
Save vjpr/16b6e1ec8deb8c24c5a2 to your computer and use it in GitHub Desktop.
Options for the file format for Live plugins.

Live plugin file format options

Options for the the file format for Live plugins.

Class

Must implement a LivePlugin shape, but does not need to extend from it.

export default class {

  $require = ['live-foo']

  $desc = 'A plugin'

  register(app) {
  }

  async init(app) {
  }

}

Props attached to function

const plugin = (app) => {

}

plugin.register = function(app) {
}

plugin.init = async function(app) {
}

plugin.desc = ''

plugin.require = ''

exports default plugin

Function

Receives an instantiated plugin as first argument (plugin: LivePlugin).

exports.register = function() {
  
}

exports.init = function() {
  
}

export.require = ['bar']

Decorator

@Require('bar')
export default class {
 
  

}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment