GithubHelp home page GithubHelp logo

redux-plugins-immutable-react's Introduction

redux-plugins-immutable-react

React helper components for redux-plugins-immutable

Introduction

npm install redux-plugins-immutable-react

These components help you inject other components from plugins into your UI. There are two helpers:

  • LoadPluginComponent: renders a component from a plugin, loading the plugin if necessary
  • PluginComponents: renders multiple components from multiple plugins

API

LoadPluginComponent

Renders a component from a plugin, loading the plugin if necessary. It will also render loading and load error messages depending on the plugin status.

propTypes

  • pluginKey (string|Symbol): the key of the plugin to load the component from
  • componentKey (?string|Symbol): if given, will get the component/element at store.getState().getIn(['plugins', pluginKey, 'components', componentKey])
  • getComponent ((plugin: Immutable.Map) => any): (overrides componentKey) if given, gets the component/element from the plugin from the redux state.
  • componentProps (Object): if given, the component/element will be created/cloned with these props
  • children: ((state: {loading: boolean, loadError?: Error, component?: any): if given, LoadPluginComponent will return the result of this function from its render() instead of its default behavior.

contextTypes

  • LoadPluginComponentSkin (React.Component): component to render the plugin status or component. It will be created with the following props:
    • pluginName (string): the plugin name
    • loading (boolean): whether the plugin is loading
    • loadError (Error): the error if the plugin failed to load
    • children (?React.Element): the plugin component if found

PluginComponents

Renders multiple components from multiple plugins. It will not load any plugins that are not loaded.

propTypes

  • componentKey (?string|Symbol): if given, will get plugin.getIn(['components', componentKey]) for each plugin in store.getState().get('plugins'). The value at these locations must be a React component, element, or an Array|Immutable.List of components/elements.
  • getComponent ((plugin: Immutable.Map) => any): (overrides componentKey) if given, gets the component/element from the plugin from the redux state. It may return a React component, element, or an Array|Immutable.List of components/elements.
  • componentProps (Object): if given, each component/element will be created/cloned with these props
  • children ((pluginComponents: any[]) => ?React.Element): if given, PluginComponents will return the result of this function from its render() instead of rendering pluginComponents inside a <div>.

redux-plugins-immutable-react's People

Contributors

jedwards1211 avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.