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 sum(total, next) { | |
return total + next; | |
} | |
var old = 0; | |
var NUM = 102; | |
var VariableInfiniteList = React.createClass({ | |
componentDidMount: function() { |
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
/** | |
* @author Eberhard Graether / http://egraether.com/ | |
* @author Mark Lundin / http://mark-lundin.com | |
* @author Simone Manini / http://daron1337.github.io | |
* @author Luca Antiga / http://lantiga.github.io | |
*/ | |
THREE.TrackballControls = function ( object, domElement ) { | |
var _this = this; |
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
//load plugins | |
var gulp = require('gulp'), | |
compass = require('gulp-compass'), | |
autoprefixer = require('gulp-autoprefixer'), | |
minifycss = require('gulp-minify-css'), | |
uglify = require('gulp-uglify'), | |
rename = require('gulp-rename'), | |
concat = require('gulp-concat'), | |
notify = require('gulp-notify'), | |
livereload = require('gulp-livereload'), |
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 setOnboardingStep(stepLabel) { | |
return { | |
type: 'SET_ONBOARDING_STEP', | |
payload: stepLabel | |
} | |
} | |
function addOnboardingMilestone(type) { | |
return { | |
type: 'ADD_ONBOARDING_MILESTONE', |
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 { browserHistory } from 'react-router'; | |
function locationReducer(state, action) { | |
switch (action.type) { | |
case 'PUSH_URL': | |
browserHistory.push(action.payload); | |
break; | |
case 'REPLACE_URL': | |
browserHistory.replace(action.payload); | |
break; |
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 exclusiveUrls = [ | |
'/onboarding/route/1', | |
'/onboarding/route/2', | |
'/onboarding/route/3', | |
// ... and so on ... | |
]; |
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
let step = null; | |
const middleware = store => next => action => { | |
switch (action.type) { | |
case 'SET_ONBOARDING_STEP': | |
step = action.payload; | |
const { url } = steps[step]; | |
// Make sure we "replace" instead of "push" when we have an on-boarding | |
// exclusive URL. | |
const redirectMethod = exclusiveUrls.indexOf(url) >= 0 ? replace : push; |
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
if (step === finalStep) { | |
// Handle all LOCATION_CHANGE action from react-router-redux. | |
if (action.type === '@@router/LOCATION_CHANGE';) { | |
// Make sure the user is redirected away from on-boarding exclusive URLs. | |
if (exclusiveUrls.indexOf(action.payload.pathname) >= 0) { | |
store.dispatch( push('/somewhere/else') ); | |
} | |
} | |
// If we're already on the last step, we don't need to steer the flow anymore, |
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
if (milestones.indexOf(action.type) >= 0) { | |
const { nextStep } = states[step]; | |
store.dispatch( setRegistrationStep(nextStep) ); | |
} |