This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const containerFunction = { | |
getMeteorData: ( props , context ) => { | |
console.log( 'context' , context ); | |
...secret code... | |
return { | |
isReady , | |
timelineEvents | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default function connect(options) { | |
let expandedOptions = options; | |
if ( typeof options === 'function' ) { | |
expandedOptions = { | |
getMeteorData: options , | |
}; | |
} | |
const { getMeteorData , pure = true , contextTypes = {} } = expandedOptions; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
OrgMainNotification.propTypes = {}; | |
export default createContainer(() => { | |
return {}; | |
}, OrgMainNotification); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { BrowserRouter, Route } from 'react-router-dom'; | |
import createBrowserHistory from 'history/createBrowserHistory'; | |
import Homepage from './pages/homepage/Homepage.jsx'; | |
import Explore from './pages/explore/Explore.jsx'; | |
import AboutUs from './pages/about-us/AboutUs'; | |
const browserHistory = createBrowserHistory(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Add this package meteor add matb33:collection-hooks | |
//Create a new file in /server/hooks.js | |
Meteor.startup(function(){ | |
Thread.models.Contacts.model.after.update((userId, doc) => { | |
console.log('doc: ' , doc); | |
Meteor.users.update({ | |
_id : doc.userId, | |
profile.userChangedName: false | |
},{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var debug = process.env.NODE_ENV !== 'production'; | |
var webpack = require('webpack'); | |
var HTMLWebpackPlugin = require('html-webpack-plugin'); | |
var HTMLWebpackPluginConfig = new HTMLWebpackPlugin({ | |
template: __dirname + '/app/index.html', | |
filename: 'index.html', | |
inject: 'body' | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Router.route('/messages', { | |
layoutTemplate : "app", | |
template : "messages" | |
name: 'my-messages’, | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Meteor.startup(function(){ | |
var toysCollection = Mongo.Collection.get('MeteorToysCredentials'); | |
if( toysCollection.find().count() === 0 ) { | |
toysCollection.insert({ | |
email : '[email protected]', | |
password :'password' | |
}); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[[[[[ ~/playground/meteor/rawCollection ]]]]] | |
=> Started proxy. | |
=> Started MongoDB. | |
=> Started your app. | |
=> App running at: http://localhost:3000/ | |
=> Exited with code: 8 | |
W20150522-01:45:48.227(1)? (STDERR) | |
W20150522-01:45:48.228(1)? (STDERR) /Users/mariorodrigues/.meteor/packages/mongo/.1.1.0.9ya52j++os+web.browser+web.cordova/npm/node_modules/mongodb/lib/mongodb/connection/base.js:246 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var funcs : [()->Int] = [] | |
for i in 0...3{ | |
funcs.append({ | |
return i | |
}) | |
} | |
for i in 0...3{ | |
println(funcs[i]()) |