Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

flummox-component

Package Overview
Dependencies
Maintainers
2
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

flummox-component

A simple way to connect React components to flummox stores and actions

  • 0.2.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
2
Created
Source

Flummox Component

A simple way to connect React components to flummox stores and actions

Installation

npm install flummox-component

Usage

ES6+ way:

import React from 'react';
import fComponent from 'flummox-component';

export default fComponent('ComponentName', {
    
    actions: ['exampleActions', 'myActions'],
    
    stores: ['exampleStore', 'myStore'],
    
    propTypes: {
        propertyOne: React.PropTypes.any,
        propertyTwo: React.PropTypes.any,
    },
    
    onClick(e) {
        this.actions.exampleActions.onClick(e);
    },
    
    render() {
        return (
            <a onClick={this.onClick}>Click me!</a>
        );
    },
    
    ...other component methods
}); 

ES5 way:

var React = require('react');
var fComponent = require('flummox-component');

module.exports = fComponent('ComponentName', {
    
    actions: ['exampleActions', 'myActions'],
    
    stores: ['exampleStore', 'myStore'],
    
    propTypes: {
        propertyOne: React.PropTypes.any,
        propertyTwo: React.PropTypes.any,
    },
    
    onClick: function(e) {
        this.actions.exampleActions.onClick(e);
    },
    
    render: function() {
        return (
            <a onClick={this.onClick}>Click me!</a>
        );
    },
    
    ...other component methods
}); 

License

Flummox component is MIT licensed.

Keywords

FAQs

Package last updated on 10 Jun 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc