npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-extensioner

v1.4.0

Published

React binding for extensioner. Make project scalability easy by improving feature management.

Downloads

2

Readme

react-extensioner

React binding for extensioner. Make project scalability easy by improving feature management.

install

npm install react-extensioner

usage

Import Manager class from extensioner

import { Manager } from "extensioner";

then import ExtensionerProvider, ExtensionerEvent components from react-extensioner

import { ExtensionerProvider, ExtensionerEvent } from "react-extensioner";

More about using Manager class in extensioner project

in general create instance of Manager class and register all exensions

For example lets create extension/feature which will have one event listener and when it is called returns some react component

        const manager = new Manager();
        manager.registerExtension("ON_RENDER_TOP_MENU", {
            events: {
                "TEST_EVENT": values => <TopMenuComponent {...values}>
            }
        });

Next at top structure ExtensionerProvider should be rendered. It can be above react-redux provider if you use redux.

It accepts one property. It is manager instance.

export default class App extends React.Component {
    render() {
        return (
            <ExtensionerProvider manager={manager}>
            
                // other react components
                
            </ExtensionerProvider>
        );
    }
}        

It can contain any react components.

In addition any number of ExtensionerEvent can be placed inside. When ExtensionerEvent is rendered it triggers configured event from all registered components

For example lets create ExtensionerEvent that will trigger event from previously registered feature - ON_RENDER_TOP_MENU

export default class App extends React.Component {
    render() {
        return (
            <ExtensionerProvider manager={manager}>
                <ExtensionerEvent name="ON_RENDER_TOP_MENU" value={ /* some values */} />
            </ExtensionerProvider>
        );
    }
}        

Above code will render all components from registered extensions that listening on this event.

API

ExtensionerProvider

It is React component it should be one of the first components

properties

  • manager - accept extension manager instance with registered components
<ExtensionerProvider manager={manager}></<ExtensionerProvider>

ExtensionerEvent

It is React component and will trigger event each time it is rendered. And later will render components from feature event listeners. Should be inside ExtensionerProvider

properties

  • name - event name
  • value - event value
<ExtensionerEvent name="SOME_EVENT_NAME" value="SOME_EVENT_VALUE" />

License

MIT