(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| /* | |
| Description: | |
| This script converts `yield call()` to `yield* call()` syntax and 'redux-saga/effects' to 'typed-redux-saga' | |
| Make sure to commit your files first before you run the below script! | |
| Usage: | |
| npx jscodeshift --parser tsx -t ./migrate-redux-saga.ts ./sagas/**\/*.ts | |
| Before: |
| # ----------------------------------- # | |
| webpack --display-modules | awk '{print $2}' | grep ^\.\/ > files-processed.txt; | |
| cd public/js/; # assumes all your files are here | |
| find . -name "*.js" | grep -v eslint | grep -v __ > ../../files-all.txt; # excludes __tests__ and .eslintrc files | |
| cd ../..; | |
| cat files-all.txt | xargs -I '{}' sh -c "grep -q '{}' files-processed.txt || echo '{}'"; | |
| rm files-processed.txt files-all.txt; | |
| # ----------------------------------- # |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| (function() { | |
| var loadSource = function(file, onSourceLoad) { | |
| if (!file.fileSrc.match(/js-test/)) { | |
| return false; | |
| } | |
| require([file.fileSrc], function() { | |
| onSourceLoad({file: file, success: true, message: ''}); | |
| }, function(err) { |