<commit_before>'use strict';

console.disableYellowBox = true;


import React, {
  Component,
  StyleSheet,
  Text,
  View,
  TouchableOpacity
} from 'react-native';

import Meteor, { connectMeteor, MeteorListView } from 'react-native-meteor';
import Button from 'react-native-button';
import Icon from 'react-native-vector-icons/MaterialIcons';

class Todos extends Component {
  constructor(props) {
    super(props);

    this.state = {
      done: false
    };
  }
  getMeteorData() {
    return {
      todos: Meteor.collection('todos').find()
    };
  }
  startMeteorSubscriptions() {
    Meteor.subscribe('todos', this.state.done);
  }
  add() {
    const { todos } = this.data;

    const item = {
      title: 'Todo '+(todos.length+1)
    };

    Meteor.collection('todos').insert(item, (err, item)=> {
      console.log(err, item);
    });
  }
  changeDone() {
    this.setState({done: !this.state.done});
  }
  edit(todo) {
    console.log('edit', todo);<commit_msg>Updated example<commit_after>'use strict';

console.disableYellowBox = true;


import React, {
  Component,
  StyleSheet,
  Text,
  View,
  TouchableOpacity
} from 'react-native';

import Meteor, { connectMeteor, MeteorListView } from 'react-native-meteor';
import Button from 'react-native-button';
import Icon from 'react-native-vector-icons/MaterialIcons';

class Todos extends Component {
  constructor(props) {
    super(props);

    this.state = {
      done: false
    };
  }
  getMeteorData() {
    return {
      todos: Meteor.collection('todos').find()
    };
  }
  startMeteorSubscriptions() {
    Meteor.subscribe('todos', this.state.done);
  }
  add() {
    const { todos } = this.data;

    const item = {
      title: 'Todo '+(todos.length+1)
    };

    Meteor.collection('todos').insert(item, (err, item)=> {
      console.log(err, item);
    });
  }
  changeDone() {
    this.setState({done: !this.state.done});
  }
  edit(todo) {
    Meteor.collection('todos').update(todo._id, {
      $set: {
        title: 'NEW TITLE'
      }
    }, err=>{
      console.log(err);
    });
{'fraction_non_alphanumeric': 0.1565217391304348, 'fraction_numerical': 0.000966183574879227, 'mean_word_length': 3.021359223300971, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6418987', 'n_tokens_mistral': 744, 'n_tokens_neox': 719, 'n_words': 131}