Skip to content

Instantly share code, notes, and snippets.

View pahund's full-sized avatar

Patrick Hund pahund

View GitHub Profile
'../node_modules/@modular-toolkit/bricks/node_modules/@modular-toolkit/selectors/src/selectModular.js\nModule not found: Error: Can\'t resolve \'redux-saga/effects\' in \'/Users/pahund/git/move-webapp/node_modules/@modular-toolkit/bricks/node_modules/@modular-toolkit/selectors/src\'\nresolve \'redux-saga/effects\' in \'/Users/pahund/git/move-webapp/node_modules/@modular-toolkit/bricks/node_modules/@modular-toolkit/selectors/src\'\n Parsed request is a module\n using description file: /Users/pahund/git/move-webapp/node_modules/@modular-toolkit/bricks/node_modules/@modular-toolkit/selectors/package.json (relative path: ./src)\n Field \'browser\' doesn\'t contain a valid alias configuration\n resolve as module\n /Users/pahund/git/move-webapp/node_modules/@modular-toolkit/bricks/node_modules/@modular-toolkit/selectors/src/node_modules doesn\'t exist or is not a directory\n /Users/pahund/git/move-webapp/node_modules/@modular-toolkit/bricks/node_modules/@modular-toolkit/selectors/node_modules d
{
"name": "polly",
"version": "9.3.0",
"description": "MOTOR-TALK discussion forum",
"main": "index.js",
"scripts": {
"build": "npm-run-all --parallel build:client build:server",
"build:client": "NODE_ENV=production ./scripts/build.js client",
"build:client:stats": "NODE_ENV=production ./scripts/build.js client --stats > client-stats.json",
"build:debug": "NODE_ENV=development ./scripts/build.js all",
@pahund
pahund / AboutPage.js
Last active October 14, 2018 20:13
Connected About Page Component, Dispatching an Action to the Hacker News Brick Component
import React from 'react';
import { connect } from 'react-redux';
import { HackerNews, loadTopStoriesAction } from '@modular-toolkit/demo-module';
const AboutPage = ({ dispatch }) => (
<main>
<header>
<h1>About Our Company</h1>
</header>
<p>We are very awesome!</p>
@pahund
pahund / AboutPage.js
Last active October 14, 2018 20:13
About page component, using the Hacker News Brick
import React from 'react';
import { HackerNews } from '@modular-toolkit/demo-module';
export default () => (
<main>
<header>
<h1>About Our Company</h1>
</header>
<p>We are very awesome!</p>
<HackerNews />
@pahund
pahund / registerSelectors.js
Last active October 14, 2018 20:13
Registering selectors for use with global state
import { registerSelectorsForUseWithGlobalState } from '@modular-toolkit/selectors';
import { selectors as hackerNews } from '@modular-toolkit/demo-module';
import { selectors as home } from './pages/home';
import { selectors as about } from './pages/about';
import { selectors as contact } from './pages/contact';
const selectorMapping = {
'bricks.hackerNews': hackerNews,
@pahund
pahund / saga.js
Last active October 14, 2018 20:13
Creating a root Redux Saga for the application
import { all, fork } from 'redux-saga/effects';
import { saga as hackerNews } from '@modular-toolkit/demo-module';
import { saga as home } from './pages/home';
import { saga as about } from './pages/about';
import { saga as contact } from './pages/contact';
const sagas = [hackerNews, home, about, contact];
@pahund
pahund / reducer.js
Last active October 14, 2018 20:14
Creating the application's reducer
import { combineReducers } from 'redux';
import { reducer as hackerNews } from '@modular-toolkit/demo-module';
import { reducer as home } from './pages/home';
import { reducer as about } from './pages/about';
import { reducer as contact } from './pages/contact';
export default combineReducers({
bricks: combineReducers({
@pahund
pahund / createInitialState.js
Last active October 14, 2018 20:14
Creating an application's initial state, including a Brick's initial state
import { createInitialState as createInitialHackerNewsState } from '@modular-toolkit/demo-module';
export default config => ({
cookieDomain: config.cookieDomain,
bricks: {
hackerNews: createInitialHackerNewsState({
topStories: [
/* …some top stories data objects… */
]
})
@pahund
pahund / index.js
Last active October 16, 2018 09:44
Root module of a Brick package
export { default as MyBrick } from './src/components/MyBrick';
export * from './src/actions';
export { default as reducer } from './src/reducer';
export { default as saga } from './src/saga';
export { default as selectors } from './src/selectors';
Uncaught Error: dropped
default
default
update
viruses.forEach.virus
update
update
d