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

PluginStore

Methods:

  • install
  • getInstalledPluginNameWithVersion
  • addFunction
  • executeFunction
  • removeFunction
  • uninstall
  • addEventListener
  • removeEventListener
  • dispatchEvent


install

It is used to register the plugin with the PluginStore.

Arguments

(IPlugin) : It contains the instance of plugin class which is implemented by IPlugin interface.

Returns

(void)


getInstalledPluginNameWithVersion

It returns the name of the plugin if it exists or null otherwise.

Arguments

(string) : name of the plugin

Returns

(string | null): It returns the plugin name if exists or null


addFunction

It is used to add a function in the PluginStore.

Arguments

  1. key (string): name of the function.
  2. function: Function definition which is to be added against the key.

Returns

(void)


executeFunction

It is used to execute the function stored in the PluginStore.

Arguments

  1. key (string): It represents the name of the function that we want to execute.
  2. ...args : arguments to be passed in the function parameters.

Returns

(void)


removeFunction

It is used to remove a function from the PluginStore.

Arguments

key (string): It represents the name of the function which is to be removed.

Returns

(void)


uninstall

It is used to uninstall the plugin from the PluginStore of the app.

Arguments

key(string): It represents the name of the plugin which needs to be uninstalled.

Returns

(void)


addEventListener

It is used to add a callback function against an event in the PluginStore.

Arguments

  1. name(string): It represents the name of the event.
  2. callback(function): It is the function which is to be added against the event.

Returns

(void)

Note: It works the same as events in javascript i.e. we can store as many callbacks for a particular event. event.stopPropagation() and event.preventDefault() also work the same way in javascript.


removeEventListener

It is used to remove a callback function against an event from the PluginStore.

Arguments

  1. name(string): It represents the name of the event.
  2. callback(function): It is the function which is to be removed.

Returns

(void)

Note: The callback which we provide will be removed from the event registry. All other callbacks present in the event will still execute on dispatching the event.


dispatchEvent

It is used to dispatch a particular event.

Arguments

event(Event): It represents the event object which is to be dispatched.

Returns

(void)

← IPluginRendererPlugin →
  • install
  • getInstalledPluginNameWithVersion
  • addFunction
  • executeFunction
  • removeFunction
  • uninstall
  • addEventListener
  • removeEventListener
  • dispatchEvent
React Pluggable
Docs
Getting StartedExamplesCore ConceptsAPI ReferencesFAQ
Community
TwitterStackoverflowDiscord
More
GitHubContribution Guidelines

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