This file contains hidden or 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, { Component } from 'react'; | |
import { | |
AppRegistry, | |
StyleSheet, | |
Text, | |
View, | |
Animated | |
} from 'react-native' | |
const arr = [] |
This file contains hidden or 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
'use strict'; | |
var React = require('react-native'); | |
var { | |
AppRegistry, | |
StyleSheet, | |
Text, | |
View, | |
Easing, | |
Animated, |
This file contains hidden or 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
this.doLogin = function(user) { | |
var deferred = $q.defer(), | |
nonce_dfd = $q.defer(), | |
authService = this; | |
authService.requestNonce("user", "generate_auth_cookie") | |
.then(function(nonce){ | |
nonce_dfd.resolve(nonce); | |
}); |
This file contains hidden or 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
// initialize | |
if (typeof PushNotification === "defined") { | |
// your code here | |
$cordovaPushV5.initialize(options).then(function() { | |
// start listening for new notifications | |
$cordovaPushV5.onNotification(); | |
// start listening for errors | |
$cordovaPushV5.onError(); | |
// register to get registrationId |
This file contains hidden or 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
{ | |
"name": "JargonAppV2", | |
"version": "0.0.1", | |
"private": true, | |
"scripts": { | |
"start": "node node_modules/react-native/local-cli/cli.js start" | |
}, | |
"dependencies": { | |
"axios": "^0.11.1", | |
"crypto-js": "^3.1.6", |
This file contains hidden or 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 Mongoose = require('mongoose'); | |
const PresidentSchema = Mongoose.Schema({ | |
name: String, | |
party: String, | |
term: String, | |
}); | |
const President = Mongoose.model('President', PresidentSchema); |
This file contains hidden or 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 request = require('request-promise'); | |
const President = require('./model'); | |
const seed = () => { | |
request('https://mysafeinfo.com/api/data?list=presidents&format=json') | |
.then(res => JSON.parse(res)) | |
.then((res) => { | |
const data = res.map((r) => { | |
const obj = {}; | |
obj.name = r.nm; |
This file contains hidden or 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 typeDefinitions = ` | |
type President { | |
name: String | |
party: String | |
term: String | |
} | |
type RootQuery { | |
president(name: String, party: String, term: String): President | |
} | |
schema { |
This file contains hidden or 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 PresidentModel = require('./model'); | |
class President { | |
constructor() { | |
this.findPresident = (name) => { | |
const person = PresidentModel.findOne({ name }, (error, data) => { | |
return data; | |
}); | |
return person; | |
}; |
This file contains hidden or 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 resolveFunctions = { | |
RootQuery: { | |
president(_, { name }, ctx) { | |
const president = new ctx.constructor.President(); | |
return president.findPresident(name); | |
}, | |
}, | |
}; | |
module.exports = resolveFunctions; |