This Gist was automatically created by Carbide, a free online programming environment.
Last active
August 6, 2016 03:41
-
-
Save antimatter15/3569e904b29579896c89cd05bbeae704 to your computer and use it in GitHub Desktop.
Merp
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
SUCH SPACE CAN YOU SEE THIS |
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
1 + 1 |
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
doc.save() |
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 "babel-polyfill"; | |
import React from 'react'; | |
import ReactDOM from 'react-dom'; | |
import { createStore } from 'redux' | |
// import { ReduxRoot, ReduceRoot } from './state/root.js' | |
var { ReduxRoot, ReduceRoot } = require('./state/root.js'); | |
module.hot.accept('./state/root.js', function(){ | |
ReduxRoot = require('./state/root.js').ReduxRoot | |
ReduceRoot = require('./state/root.js').ReduceRoot | |
}) | |
// import App from './react/app.js'; | |
var App = require('./react/app.js').default; | |
module.hot.accept('./react/app.js', function(){ | |
App = require('./react/app.js').default; | |
store.dispatch({ type: '@@RELOAD' }) | |
}) | |
import INITIAL_DATA from './initial-data.js' | |
module.hot.accept('./initial-data.js', function(){ /* do nothing */ }) | |
// module.hot.accept() | |
function reducer(state, action){ | |
if(action.from === 'cursor'){ | |
var redroot = new ReduceRoot(state) | |
var cursor = redroot.resolve(action.path); | |
if(!cursor) throw new Error('could not find cursor at path ' + action.path.join('/')); | |
var fn = cursor[action.meth]._action; | |
var new_cursor_data = fn.apply(cursor, action.args); | |
if(typeof new_cursor_data === 'undefined') throw new Error('action did not return new data'); | |
return cursor.bubble(new_cursor_data) | |
} | |
return state | |
} |
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
{"cells":[{"probes":[],"id":"scratch0","name":"cell0.js"},{"probes":[{"start":0,"end":10,"id":"&hj9py5"}],"id":"&1drc5i","name":"cell1.js"},{"probes":[],"id":"cell0","name":"cell2.js"}],"selections":[{"head":{"line":1,"ch":10},"anchor":{"line":1,"ch":10}}],"kernel_name":"Javascript","title":"Merp"} |
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
// meowth |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment