Giter Club home page Giter Club logo

connect-alt's People

Contributors

djbobbydrake avatar iam4x avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

connect-alt's Issues

How to access static methods of DecoratedComponent?

Hi again!

I've been playing around with using react-router onEnter hook to fetch async data from the next component/page if needed. I sort of had this working before by doing something like:

const { component } = nextState.routes[1];

if (typeof component.fetchData === 'function') {
   // ... trigger fetchData and then listen to requests store changes
}

I am not sure how to go about this as the component that react-router now provides is the ConnectToStoresWrapper. Any ideas?

Accessing DecoratedComponent[prop] causes TypeError in Safari in production

This line seems to be breaking things on Safari (Version 9.0 (11601.1.56)) and iOS Safari (latest), but only when running in production mode. No idea why.

It seems that accessing DecoratedComponent[prop] will throw a TypeError for certain properties (e.g. there is one called 'arguments'). Adding a try/catch block round the if statement this seems to prevent the error...

The error completely stops the app from bootstrapping on the client.

screen shot 2015-11-04 at 22 30 36
screen shot 2015-11-04 at 22 27 58

npm install: dist folder is empty

upgrade from 1.0.7 to 1.1.3
dist folder is empty in npm_modules/connect-alt/dist
import connect from 'connect-alt'

fails complaining that connect-alt is not found

import connect from 'connect-alt/src/main.js'

works fine

React Native

Hi will this work with react-native.

Thanks in advance.
:0)

Give control over pure rendering?

A part of my application wasn't rendering. I realized this was because pure rendering kicked in. I had a case like this:

@connect('lanes')
export default class App extends React.Component {...}

...
@connect('notes')
export default class Lane extends React.Component {...}

The idea is that the latter component relies indirectly on lanes (contains lane ids against which to filter using those notes). Since it's indirect and I pass just lane ids to Lane, notes weren't changed and it didn't render. I managed to hack around this by attaching another @connect to Lane but that feels a little wrong way to deal with it.

Is there a way to call the methods which stores expose by the way? Looks like connect gives access only to data.

Allow actions to be passed to match Redux interface

Example:

@connect(({notes}) => ({notes}), {
  noteActions: NoteActions,
  laneActions: LaneActions
})

Demo implementation:

import React from 'react';
import connect from 'connect-alt';

const connectAdapter = (Component, state, actions) => {
  return class ConnectAdapter extends React.Component {
    render() {
      return <Component {...Object.assign({}, this.props, actions)} {...this.state} />;
    }
  };
};


export default (state, actions) => {
  return (target) => connect(state)(connectAdapter(target, state, actions));
};

It would be better if connect-alt did this, though.

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.