AdamBrodzinski / meteor-flux-leaderboard

Flux Example with React & Meteor
131 stars 19 forks source link

meteor-flux-leaderboard

Flux Example with React & Meteor

Get the benifits of Relay without the wait or complexity

Plus

Different Flux examples


Make sure to open the console to see the lifecycle

logs

Example Photo

Full Readme coming soon! (See this readme for an explanation of the Meteor parts)

Usage


Todo

Key pieces are in CollectionActions/Store, Tracker watches for changes on the Minimongo clientside cache and emits a change event when data changes. This retains all the optimistic UI and realtime data capabilities that Meteor offers.

 Tracker.autorun(computation => {
    var docs = Players.find({}).fetch();

    if (computation.firstRun) return; // ignore first empty run

    this.CollectionActions.playersChanged(docs);
  });

This is simplified by using a helper package, though I think it's important to know how it works.

trackCollection(Players, CollectionActions.playersChanged);

Alt perks

Alt lets you take snapshots of your apps state and can undo/redo state as needed. You can use this to capture your app state on an error then send log it for debugging remotely.

A chrome extension is availible to help with local debugging:
https://www.youtube.com/watch?v=LUksOCuRjkE

Contributors: