New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

react-native-meteor

Package Overview
Dependencies
Maintainers
1
Versions
69
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-meteor

DDP React-native Client

  • 1.0.0-beta2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
24
increased by50%
Maintainers
1
Weekly downloads
 
Created
Source

GitHub version npm version Dependency Status devDependency Status MIT bitHound Score

react-native-meteor

Meteor-like methods for React Native. Currently in v1.0.0-beta1 ! For old docs, see v0.6.2 documentation (classic ddp interface).

What is it for ?

The purpose of this library is :

  • to set up and maintain a ddp connection with a ddp server, freeing the developer from having to do it on their own.
  • be fully compatible with react-native and help react-native developers.
  • to match with Meteor documentation used with React.

Install

npm i --save react-native-meteor

!! See detailed installation guide

Example usage


import { View, Text, Component } from 'react-native';
import Meteor, { connectMeteor } from 'react-native-meteor';

/*
* Uses decorators (see detailed installation to activate it)
* Or use :

  class Todos extends Component {
    ...
  }
  connectMeteor(Todos);
  export default Todos;

*/

@connectMeteor
export default class App extends Component {
  componentWillMount() {
    const url = 'http://192.168.X.X:3000/websocket';
    Meteor.connect(url);
  }
  startMeteorSubscriptions() {
    Meteor.subscribe('todos');
  }
  getMeteorData() {
    return {
      todos: Meteor.collection('todos').find()
    };
  }
  render() {
    const { todos } = this.data;

    {todos.map(todo=>{
      return (
        <View key={todo._id}>
          <Text>{todo.title}</Text>
        </View>
      )
    })}

  }
}

MeteorMixin

startMeteorSubscriptions

Inside this method, you can create subscriptions (see below) when component is mounted. It will automatically unsubscribe if the component is unmounted.

Meteor.subscribe

getMeteorData

Inside getMeteorData, you can access any Meteor reactive data source, which means :

API

Meteor.connect(endpoint)

Connect to a DDP server. You only have to do this once in your app.

Arguments
  • url string required

Meteor methods

Keywords

FAQs

Package last updated on 02 Mar 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