React Pluggable

React Pluggable

  • Docs
  • FAQ
  • Github
  • Hire The Creators

›Api References

Getting Started

  • Introduction
  • Installation
  • Motivation

Examples

  • Hello World
  • Renderer Example
  • Event Example
  • Typing Example
  • Todo App

Core Concepts

  • Dependencies
  • Typing
  • How to create a Plugin
  • Events

Api References

  • API Overview
  • Plugin
  • IPlugin
  • PluginStore
  • RendererPlugin

Tips and Tricks

  • Naming Convention

FAQ

  • FAQ's

IPlugin

It is an Interface used to create a Plugin. If you want to create a plugin, you have to implement your class with the IPlugin interface.

Variables

It contains one variable pluginStore which is is used to store the PluginStore for the given plugin.

Methods:

  • getPluginName
  • getDependencies
  • init
  • activate
  • deactivate


getPluginName

Gives you the name and version of the plugin.

Arguments

(void)

Returns

(string) of the pattern "<plugin_name>@<plugin_version>"

Example

getPluginName(): string {
    return "ClickMe@1.1.0";
}


getDependencies

Gives you the plugins which have to be installed before the plugin itself.

Arguments

(void)

Returns

(Array): An array of Plugins in the string format.

Example

getDependencies():void {
    return ["plugin1@1.1.0","plugin2@0.1.0"];
}


init

It is used to initialise the plugin class.

Arguments

(PluginStore) : It is an instance of the PluginStore which installs the plugin class.

Returns

(void)

Example

init(pluginStore: PluginStore): void {
   this.pluginStore = pluginStore;
}


activate

It performs operations to activate features which can be used once the plugin is active.

Arguments

(void)

Returns

(void)

Example

activate(): void {
    this.pluginStore.addFunction(
      `${this.namespace}.sendAlert`,
      (msg: string) => {
        alert(msg);
      }
    );
  }


deactivate

It performs operations to remove features once the plugin gets deactivated.

Arguments

(void)

Returns

(void)

Example

deactivate(): void {
    this.pluginStore.removeFunction(`${this.namespace}.sendAlert`);
  }
← PluginPluginStore →
  • getPluginName
  • getDependencies
  • init
  • activate
  • deactivate
React Pluggable
Docs
Getting StartedExamplesCore ConceptsAPI ReferencesFAQ
Community
TwitterStackoverflowDiscord
More
GitHubContribution Guidelines

Star
Built with ♥ at GeekyAnts
Copyright © 2020 React Pluggable.