350 open graph react #360

Merged
bones7242 merged 30 commits from 350-open-graph-react into master 2018-02-24 17:55:00 +01:00
3 changed files with 2 additions and 35 deletions
Showing only changes of commit b4ef61ae85 - Show all commits

View file

@ -12,35 +12,6 @@ import { call } from 'redux-saga/effects';
import { handleShowPageUri } from '../react/sagas/show_uri'; import { handleShowPageUri } from '../react/sagas/show_uri';
import { onHandleShowPageUri } from '../react/actions/show'; import { onHandleShowPageUri } from '../react/actions/show';
// const waitAll = (sagas) => {
// console.log('sagas', sagas);
// return function * () {
// const tasks = yield sagas.map(([saga, params]) => {
// console.log('saga to fork:', saga);
// console.log('params fork:', params);
// fork(saga, params);
// });
// console.log('tasks', tasks);
// console.log('before join');
// yield tasks.map(join);
// console.log('after join');
// };
// };
//
// const getPreloaders = (req) => {
// let preloaders = [];
// routes.some(route => {
// const match = matchPath(req.path, route);
// if (match) {
// let preloadData = route.component.preloadData;
// if (preloadData instanceof Function) {
// preloaders.push([preloadData(), mockAction(match.params)]);
// };
// };
// });
// return preloaders;
// };
const returnSagaWithParams = (saga, params) => { const returnSagaWithParams = (saga, params) => {
return function * () { return function * () {
yield call(saga, params); yield call(saga, params);
@ -57,9 +28,8 @@ module.exports = (req, res) => {
// create a new Redux store instance // create a new Redux store instance
const store = createStore(Reducer, middleware); const store = createStore(Reducer, middleware);
// get params
const action = onHandleShowPageUri(req.params);
// create saga // create saga
const action = onHandleShowPageUri(req.params);
const saga = returnSagaWithParams(handleShowPageUri, action); const saga = returnSagaWithParams(handleShowPageUri, action);
// run the saga middleware // run the saga middleware
@ -84,7 +54,7 @@ module.exports = (req, res) => {
console.log('REDIRECTING:', context.url); console.log('REDIRECTING:', context.url);
return res.redirect(301, context.url); return res.redirect(301, context.url);
} else { } else {
console.log(`we're good, send the response`, html); console.log(`we're good, send the response`);
} }
// get the initial state from our Redux store // get the initial state from our Redux store

View file

@ -26,7 +26,6 @@ export default function (state = initialState, action) {
}), }),
}); });
case actions.REQUEST_UPDATE: case actions.REQUEST_UPDATE:
console.log('REQUEST UPDATE');
return Object.assign({}, state, { return Object.assign({}, state, {
request: Object.assign({}, state.request, { request: Object.assign({}, state.request, {
type: action.data.requestType, type: action.data.requestType,

View file

@ -7,8 +7,6 @@ import lbryUri from 'utils/lbryUri';
function * parseAndUpdateIdentifierAndClaim (modifier, claim) { function * parseAndUpdateIdentifierAndClaim (modifier, claim) {
console.log('parseAndUpdateIdentifierAndClaim'); console.log('parseAndUpdateIdentifierAndClaim');
console.log('modifier:', modifier);
console.log('claim:', claim);
// this is a request for an asset // this is a request for an asset
// claim will be an asset claim // claim will be an asset claim
// the identifier could be a channel or a claim id // the identifier could be a channel or a claim id