0.0.56 • Published 8 years ago

meteor-standalone-react-mixin v0.0.56

Weekly downloads
46
License
MIT
Repository
github
Last release
8 years ago

ReactMeteorData

This is a standalone version meant for use OUTSIDE of Meteor projects. It has been minimally modified for installation with NPM and framework-agnostic use.

Check out the Todo to see how it works

This mixin is a convenient way to use data from a Meteor reactive data source in a React component, with automatic updates when the data changes.

getMeteorData is a reactive context. Whatever is returned is available on the React object's .data property.

More complete docs available at the example Todo repo

Quick Example:

import { Mongo, ReactMeteorData } from 'meteor-standalone-react-mixin'

var Todos = new Mongo.Collection('todos');

TodoApp = React.createClass({
  mixins: [ReactMeteorData],
  getMeteorData() {
    // Reactive context
    // do all your reactive data access in this method.
    return {
      todos: Todos.find().fetch(),
    };
    // /Reactive context
  },
  render() {
    return <div>
      <span>{this.data.todos.map(<TodoItem todo={todo}/>)}</span>
    </div>;
  }
});

Full example in the Todo Sample Application

Meteor docs.

API

This package exposes:

  • Mongo.Collection
  • Minimongo
  • ReactiveDict
  • ReactiveVar
  • Tracker
  • EJSON
  • ... and more!
0.0.56

8 years ago

0.0.55

8 years ago

0.0.54

8 years ago

0.0.5

8 years ago

0.0.4

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago