Skip to content

Commit

Permalink
some fixes to example, debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
Julian Kingman committed Mar 30, 2017
1 parent 3b9ca00 commit 343a1ad
Show file tree
Hide file tree
Showing 7 changed files with 82 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
node_modules/
.idea/
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,17 @@ export createContainer((props) => {
};
}, component)
````

### Running the example
Execute the following commands:
````bash
cd example/RNApp && npm i
cd ../MeteorApp && meteor
cd ../RNApp && react-native run-ios
# or
cd ../RNApp && react-native run-android
````
If you get .babelrc errors, try running this in the RNApp directory
````bash
./node_modules/react-native/packager/packager.sh start --reset-cache
````
1 change: 1 addition & 0 deletions connectMeteorRedux.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ const subscribeCached = (store, name, ...args) => {
return Meteor.subscribe(name, ...args);
}
});
console.log(arguments, JSON.stringify(arguments));
// fallback if store not initialized
if (!store) return Meteor.subscribe(name, ...args);
// if callback exists, run it
Expand Down
2 changes: 1 addition & 1 deletion example/MeteorApp/server/publications/details.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Meteor } from 'meteor/meteor';
import { Details } from '/collections/';
import { Details } from '/lib/collections/';

export default () => {
Meteor.publish('details-list', () => {
Expand Down
66 changes: 63 additions & 3 deletions example/MeteorApp/server/seeds.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,70 @@ import Details from '/lib/collections/details';

const seed = () => {
if (Details.find().count() === 0) {
let count = 10;
let doc = {name: {first: 'Some', last: 'detail'}};
if (Meteor.settings.powerHungry) {
count = 10000;
doc = {
"name": 'Detail',
"index": 0,
"guid": "dd3401b0-d802-40ba-8ad2-98cc1b393846",
"isActive": true,
"balance": "$3,616.93",
"picture": "http://placehold.it/32x32",
"age": 35,
"eyeColor": "brown",
"name": {
"first": "Johnnie",
"last": "Merritt"
},
"company": "LIQUICOM",
"email": "[email protected]",
"phone": "+1 (826) 589-3689",
"address": "420 Railroad Avenue, Denio, Missouri, 2330",
"about": "Cupidatat enim velit esse incididunt. Laborum ex exercitation cillum officia irure eiusmod occaecat veniam aliqua enim cupidatat. Qui enim tempor mollit ut consectetur aliquip elit.",
"registered": "Saturday, December 17, 2016 2:58 AM",
"latitude": "6.621428",
"longitude": "81.120502",
"tags": [
"aliqua",
"elit",
"sint",
"occaecat",
"duis"
],
"range": [
0,
1,
2,
3,
4,
5,
6,
7,
8,
9
],
"friends": [
{
"id": 0,
"name": "Branch Morse"
},
{
"id": 1,
"name": "Knapp Kent"
},
{
"id": 2,
"name": "Valenzuela Hammond"
}
],
"greeting": "Hello, Johnnie! You have 9 unread messages.",
"favoriteFruit": "strawberry"
};
}
for (let i = 0; i < 10; i++) {
Details.insert({
name: `Detail #${i}`
});
Details.insert(doc);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion example/RNApp/app/routes/Details/Details.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const Details = ({ detailsReady }) => {
<MeteorListView
contentContainerStyle={styles.list}
collection="details"
renderRow={(detail) => <Text style={styles.item}>{detail.name}</Text>}
renderRow={(detail) => <Text style={styles.item}>{`${detail.name.first} ${detail.name.first}`}</Text>}
/>
</View>
);
Expand Down
2 changes: 1 addition & 1 deletion example/RNApp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"react-native-keyboard-spacer": "^0.3.0",
"react-native-meteor": "^1.0.0-rc14",
"react-native-tab-navigator": "^0.3.3",
"react-native-meteor-redux": "^1.1.11"
"react-native-meteor-redux": "DesignmanIO/react-native-meteor-redux"
},
"devDependencies": {
"babel-eslint": "^7.0.0",
Expand Down

0 comments on commit 343a1ad

Please sign in to comment.