Example #1
0
 initializeAsync((data) => {
   console.log('Done! Sending data back to main window')
   // Send message back to main window with initialization result
   send('plugin.message', {
     name,
     data,
   })
 }, pluginSettings.getUserSettings(name))
Example #2
0
export const initializePlugin = (name) => {
  const { initialize, initializeAsync } = plugins[name]
  if (initialize) {
    // Foreground plugin initialization
    try {
      initialize()
    } catch (e) {
      console.error(`Failed to initialize plugin: ${name}`, e)
    }
  }

  if (initializeAsync) {
    // Background plugin initialization
    send('initializePluginAsync', { name })
  }
}