jackielii / simplest-redux-example Goto Github PK
View Code? Open in Web Editor NEWSimplest redux + react example
Home Page: http://jackielii.github.io/simplest-redux-example/
Simplest redux + react example
Home Page: http://jackielii.github.io/simplest-redux-example/
I would be great in case of a share or develop functionality like CRUD operation with small sample with this so that everyone can get an exact idea over the redux structure.
I used this repo as a starter a few days ago and it worked great. I just cloned it again as a new starter and got this:
Uncaught TypeError: children is not a function
Putting the wrapper back fixes the error:
{() => <App />}
Commit: 62e6f34
This was a fresh clone with a successful npm install
Proptypes are being phased out, to be replaced with flow annotations
Maybe create 2 branches or samples, one with flow type, and one without.
Running npm install resulted in this npm-debug.log:
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'start' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info prestart [email protected]
6 info start [email protected]
7 verbose unsafe-perm in lifecycle true
8 info [email protected] Failed to exec start script
9 verbose stack Error: [email protected] start: watchify --debug --extension=js -o bundle.js index.js & python -m SimpleHTTPServer
9 verbose stack Exit status 1
9 verbose stack at EventEmitter. (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:214:16)
9 verbose stack at emitTwo (events.js:87:13)
9 verbose stack at EventEmitter.emit (events.js:172:7)
9 verbose stack at ChildProcess. (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:24:14)
9 verbose stack at emitTwo (events.js:87:13)
9 verbose stack at ChildProcess.emit (events.js:172:7)
9 verbose stack at maybeClose (internal/child_process.js:827:16)
9 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
10 verbose pkgid [email protected]
11 verbose cwd /Users/ejane/Programming/react/simplest-redux-example-master
12 error Darwin 15.4.0
13 error argv "/usr/local/bin/node" "/usr/local/bin/npm" "start"
14 error node v4.4.1
15 error npm v2.14.20
16 error code ELIFECYCLE
17 error [email protected] start: watchify --debug --extension=js -o bundle.js index.js & python -m SimpleHTTPServer
17 error Exit status 1
18 error Failed at the [email protected] start script 'watchify --debug --extension=js -o bundle.js index.js & python -m SimpleHTTPServer'.
18 error This is most likely a problem with the simplest-redux-example package,
18 error not with npm itself.
18 error Tell the author that this fails on your system:
18 error watchify --debug --extension=js -o bundle.js index.js & python -m SimpleHTTPServer
18 error You can get information on how to open an issue for this project with:
18 error npm bugs simplest-redux-example
18 error Or if that isn't available, you can get their info via:
18 error
18 error npm owner ls simplest-redux-example
18 error There is likely additional logging output above.
19 verbose exit [ 1, true ]
Request you to provide sample example with exact redux file strucure and folder structure.
Thanks for this great example, it helped me finally understand how to use Redux (especially the ES5 example.)
However, I couldn't run it on my system because of the python dependency. Just thought I'd bring this up in case this example can run off a node server, especially as it's aimed towards beginners.
git branch gh-pages
git push origin gh-pages
Then link to it in the description:
simplest-redux-example/index.js:35
这个counter函数的default是不是返回一个新的state会比较好?比如return {...state}
Just an idea.
> [email protected] start /Users/dan/p/simplest-redux-example
> watchify --extension=js -o bundle.js index.js & python -m SimpleHTTPServer
sh: watchify: command not found
I think watchify
needs to be in devDependencies
?
Using version 7.3.0 of babelify, some functionality has been moved to plugins, which aren't included by default. Using that version of babelify, I had to do the following additional steps:
npm install --save-dev babel-preset-es2015 babel-preset-react
Then update the transform in the package.json:
"browserify": {
"transform": [
[ "babelify", { "presets": ["es2015", "react"] } ]
]
},
i want to increment by 5 or 6,
but the condition is that i have to pass this data when i click on button.
something like Increase
then the counter will be 0,5,10,15,......
something like Increase
then the counter will be 0,3,6,9,12......
in short i will pass the value from button click.
Removing React would simplify this example even further, although I think people looking into Redux will most likely be using it with React. Just something to consider.
Thanks for sharing this.
The project seems to be dependent on python to run which is absolutely nonsense as nodejs is already a web server. Without installed python the simplest-redux-example just doesn't work which is somewhat hilarious.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.