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
| // By Jamie Chapman, @chappers57 | |
| // License: open, do as you wish, just don't blame me if stuff breaks ;-) | |
| public class ParseProxyObject implements Serializable { | |
| private static final long serialVersionUID = 1L; | |
| private HashMap<String, Object> values = new HashMap<String, Object>(); | |
| private String ObjectId; | |
| private Date CreatedAt; | |
| private Date UpdatedAt; |
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
| <!--INSERT THIS TAG WHERE YOU WANT TO PLACE THE WIDGET--> | |
| <!--you can set the width and height using css rules--> | |
| <div id="ot__ondetem" style="width:800px; height: 400px"></div> | |
| <!--INSERT THIS JUST BEFORE THE BODY END--> | |
| <script> | |
| (function(d, s, id) { | |
| var gtin = 10527; | |
| var js, fjs = d.getElementsByTagName(s)[0]; | |
| if (d.getElementById(id)) return; |
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
| dispatch({type: CALL_API_REQUEST}); | |
| http.get('http://api.myapp.com/service') | |
| .then( | |
| (result) => dispatch({type: CALL_API_SUCCESS, body: result}), | |
| (error) => dispatch({type: CALL_API_FAILURE, error: error}), | |
| ); |
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 http from './HttpClient'; //simple http request manager | |
| export function getContacts({ userId }) { | |
| const payload = { userId }; | |
| return { | |
| types: [ | |
| GET_CONTACTS_REQUEST, | |
| GET_CONTACTS_SUCCESS, | |
| GET_CONTACTS_FAILURE, | |
| ], |
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
| export function callAPIMiddleware(store) { | |
| const { dispatch, getState } = store; | |
| return next => action => { | |
| const { | |
| types, | |
| callAPI, | |
| payload = {}, | |
| } = action; |
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
| function logger(store) { | |
| const { dispatch, getState } = store; | |
| return next => action => { | |
| console.group(action.type); | |
| console.info('dispatching', action); | |
| let result = next(action); | |
| console.log('next state', getState()); | |
| console.groupEnd(action.type); | |
| return result; | |
| }; |
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 { applyMiddleware, createStore } from 'redux'; | |
| import callAPIMiddleware from './callAPIMiddleware'; | |
| let store = createStore( | |
| rootReducer, | |
| initialState, | |
| applyMiddleware(callAPIMiddleware) | |
| ); |
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 asyncAction = { | |
| types: [ | |
| CALL_API_REQUEST, | |
| CALL_API_SUCCESS, | |
| CALL_API_FAILURE, | |
| ], | |
| callAPI: () => http.get('http://api.myapp.com/service', {id: 1}), | |
| payload: {id: 1}, | |
| } |
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'; | |
| const { | |
| LineChart, | |
| Line, | |
| XAxis, | |
| YAxis, | |
| CartesianGrid, | |
| Tooltip, | |
| Legend | |
| } from 'recharts'; |
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 from 'react'; | |
| import { render } from 'react-dom'; | |
| import { Router, Route, Link, browserHistory } from 'react-router'; | |
| const App = React.createClass({ | |
| render() { | |
| const { children } = this.props; | |
| return ( | |
| <div> | |
| {/* you can insert the menu here */} |
OlderNewer