Skip to content

Commit

Permalink
Minor changes and fixes (#6)
Browse files Browse the repository at this point in the history
* start of demo page work for stocks

* Adjustments and preparations for demo
  • Loading branch information
glitch100 committed Mar 25, 2017
1 parent 84586a0 commit e171569
Show file tree
Hide file tree
Showing 36 changed files with 142 additions and 26,196 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ lib/
node_modules/
npm-debug.log
npm-debug.log*
/build
/dist
.npmrc
.DS_Store
dist
23 changes: 23 additions & 0 deletions OLD_DEMO.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import ReactDOM from 'react-dom';
import React from 'react';
import { createStore, applyMiddleware, compose, combineReducers } from 'redux';
import { Provider } from 'redux-synapse';
import thunkMiddleware from 'redux-thunk';
import reducers from './reducers';
import App from './components/App';

const composeEnhancers = typeof window !== 'undefined'
&& window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ ?
window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__
: compose;

const createStoreWithMiddleware = composeEnhancers(applyMiddleware(thunkMiddleware))(createStore);
const store = createStoreWithMiddleware(combineReducers(reducers));

ReactDOM.render(
<Provider store={store}>
<App />
</Provider>,
document.getElementById('app')
);

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# `redux-synapse`
<img src="http://i.imgur.com/hAuOOkL.png" />

`redux-synapse` is a library that is heavily inspired by `react-redux` and acts as an alternative for the binding of react components to the store in a more explicit manner. The primary difference is the nature in which each component must declare explicity what updates should affect the component via its higher order component; a `synapse`.
`redux-synapse` is a library that is heavily inspired by `react-redux` and acts as an alternative for the binding of react components to the store in a more explicit manner. The primary difference is the nature in which each component must declare explicity what updates should affect the component via its higher order component; a `synapse`. With `synapse`'s it is possible to achieve a higher level of performance, than you would with alternative libraries.

A `synapse` is declared to listen to specific messages and act upon them. This is an early release of something that I intend to grow over time and build upon to make more efficient.

Expand Down
2 changes: 1 addition & 1 deletion examples/index.html → demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
<div id="app">
<h1>Loading Synapse Demo...</h1>
</div>
<script src="./build/bundle.js" ></script>
<script src="./dist/bundle.js" ></script>
</body>
</html>
23 changes: 23 additions & 0 deletions demo/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import ReactDOM from 'react-dom';
import React from 'react';
import { createStore, applyMiddleware, compose, combineReducers } from 'redux';
import { Provider } from 'redux-synapse';
import thunkMiddleware from 'redux-thunk';
import reducers from './stock/reducers';
import StockApp from './stock/components/StockApp';

const composeEnhancers = typeof window !== 'undefined'
&& window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ ?
window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__
: compose;

const createStoreWithMiddleware = composeEnhancers(applyMiddleware(thunkMiddleware))(createStore);
const store = createStoreWithMiddleware(combineReducers(reducers));

ReactDOM.render(
<Provider store={store}>
<StockApp />
</Provider>,
document.getElementById('app')
);

Empty file.
Empty file added demo/stock/reducers/index.js
Empty file.
42 changes: 42 additions & 0 deletions demo/webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
const webpack = require('webpack');
const path = require('path');

const config = {
devServer: {
open: true, // Open in browser
contentBase: __dirname,
},
entry: {
app: __dirname + '/index.js',
},
module: {
rules: [
{
test: /\.js$/, // Check for all js files
use: [{
loader: 'babel-loader',
options: { presets: ['stage-0'] },
}],
},
{
test: /\.(sass|scss)$/, // Check for sass or scss file names
use: [
'style-loader',
'css-loader',
'sass-loader',
],
},
],
},
output: {
path: __dirname + '/stock/dist',
filename: '[name].bundle.js',
},
resolve: {
alias: {
'redux-synapse': path.resolve(__dirname, '../src/index.js'),
},
},
};

module.exports = config;
4 changes: 0 additions & 4 deletions examples/actions/constants.js

This file was deleted.

9 changes: 0 additions & 9 deletions examples/actions/index.js

This file was deleted.

58 changes: 0 additions & 58 deletions examples/build/0.04d2778573f71ba27578.hot-update.js

This file was deleted.

18 changes: 0 additions & 18 deletions examples/build/0.5fe74a2dfd1be06543c7.hot-update.js

This file was deleted.

1 change: 0 additions & 1 deletion examples/build/04d2778573f71ba27578.hot-update.json

This file was deleted.

58 changes: 0 additions & 58 deletions examples/build/1.04d2778573f71ba27578.hot-update.js

This file was deleted.

18 changes: 0 additions & 18 deletions examples/build/1.5fe74a2dfd1be06543c7.hot-update.js

This file was deleted.

1 change: 0 additions & 1 deletion examples/build/5fe74a2dfd1be06543c7.hot-update.json

This file was deleted.

Loading

0 comments on commit e171569

Please sign in to comment.