Giter Site home page Giter Site logo

meteor-flux-leaderboard's People

Contributors

adambrodzinski avatar juanbrujo avatar

Stargazers

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

Watchers

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

meteor-flux-leaderboard's Issues

Still active

Hey looking into flux and wanted to know if this example was still being worked on?

Determining whether a collection has loaded.

If I subscribe to data in a controller component thus:

componentWillMount() {
  this.sub = Meteor.subscribe('campaigns');
},

And I've connected this all up with Redux such that the component's props receive the campaigns:

const filterState = function filterState(state) {
  return {
    campaigns: state.campaigns,
  };
};

CampaignPage = connect(filterState)(CampaignPage);

Then it's possible to determine when the subscription is ready in render() with this.sub.ready() but at this time the data is in MiniMongo but not yet available via redux / this.props.campaigns. If I log the following within render():

console.log(this.sub.ready(), this.props.campaigns);

Then I'll get:

false undefined // sub not ready, data not available
true undefined  // sub ready, data in minimongo but not available via props
true Object {}  // sub ready, data available via redux / props

Do you know of any way to reliably determine when the data is loaded and available via redux props?

Any plans to complete the Alt example referenced in the readme?

Hey Adam,

I know you are super busy but was wondering if you have any plans to complete the Alt example referenced towards the bottom of your readme? We've been using Meteor for quite awhile but are new to React and recently VERY new to Flux and it's varying flavors. We're being pushed to use Alt because of it's container abstraction and overall effort to decrease boilerplate. But I cannot find a good example of Meteor and Alt (ideally with React in the mix) anywhere and all your stuff is usually very solid so I keep checking for this and frowning.

If you have no time or plans for this that's cool - just let me know! I'll close this and keep looking.

Subscription

// Client Main.jsx

shDD = Meteor.subscribe ('DD', null);

Meteor.startup(function() {
  let ddCC = 0;
  Tracker.autorun (function(computation) {
      // Subscription.ready() is reactive.
      if (shDD.ready()) {
        if (computation.firstRun) {
          return;  // ignore first empty run
        }

        ddCC += 1;  // to say something changed
        store.dispatch(Actions.ddChanged(ddCC));
      }
  });
});


// On different times

shDD = Meteor.subscribe ('DD', 'aaaaa');
...
shDD = Meteor.subscribe ('DD', 'bbbbb');
...
shDD = Meteor.subscribe ('DD', 'ccccc');

Tracker listens those 3 subscriptions.! Even handle different.
Related records are in minimongo. (Caching like subsManager)
Is there something wrong?

SSR & Immutable Stores?

Was wondering where you are on the ToDo list? Are you including SSR soon and Immutable Stores?

How can I get posts by page id?

Hello, I do everything that you write in flux leaderboard. But i have one problem. For example, I have Page Component, It renders Post components inside. Every Post has pageID.
On route i mount page component with props ID, where i can get posts by pageID with your helpers?

Redux sample improvement?

AppContainer.jsx

function mapDispatchToProps(dispatch) {
  return Redux.bindActionCreators(Actions, dispatch);
};

AppContainer = connect(mapStateToProps, mapDispatchToProps)(AppContainer);

in Player.jsx (and others), no need to define handleClick(), just call dispatch on onClick (should be function)

PlayerItem = React.createClass({
  getClassName() {
    var selectedId = this.props.selectedPlayerId;
    var playerId = this.props.player._id;
    return (selectedId === playerId) ? 'player selected' : 'player';
  },

  render() {
    var player = this.props.player;
    return (
      <li className={ this.getClassName() } 
          onClick={ () => this.props.selectPlayer(this.props.player._id) }>
        <span className="name">{ player.name }</span>
        <span className="score">{ player.score }</span>
      </li>
    );
  }
});

Even JedWatson/classnames also helpfull.

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.