FZ-REACT-CLI is a cli tool to create and build react project and js library
npm install fz-react-cli -g
fz-react-cli app <appname>
npm run start
default running port 9090
npm run docs --server:componentPath=./src/components/
default running port 9292
If src folder name changed to appfolder then
npm run docs --server:componentPath=./<appfolder>/components/
fz-react-cli library <libraryname>
fz-react-cli cluster:monitor
cluster config object
{ "cluster":[ { "ip": "localhost", "port": "4040" }, { "ip": "localhost", "port": "4050" } ] }
fz-react-cli node <host> <port> <branch>
Learn all topic in deep. I will explain basic in the following section
var target = Object.assign(target,source1,source2,...);
The Object.assign() method is used to copy the values of all properties from source objects to a target object. It will return the target object.
Map function used to map value to correponding array element
var a1=[1,2,3]; var a2=a1.map(function(val){ return val*2; }) a1=[1,2,3] a2=[2,4,6]
Filter function used to filter values from give array
var a1=[1,2,3]; var a2=a1.filter(function(val){ val%2; }) a1=[1,2,3] a2=[1,3]
Reduce function used to reduce one dimention array to single value.
var a1=[1,2,3]; var a2=a1.reduce(function(result,next){ return result+next; },0) a1=[1,2,3] a2=6
Try these examples Link
function test(a,b){ return a+b } var test = (a,b) => { return a+b } only return directly return no need curly braces var test = (a,b) => a+b Single argument no need function of parentheses var test = a => a+10; function test(){ return { a:1 } } object return using arrow function var test = () => ({a:1})
class Test{ } class Test{ constructor(){ super(); } } class Test{ constructor(){ } get(){ //instance method } } Test.method=function(){ //static method } Test.obj={} //Static member
var str1="Hello" var str2="World" var newString=str1+", "+str2; var newString =`${str1}, ${str2}`
Callback hell... function test(cb){ code... may throw error cb(); } function test1(cb){ code... may throw error test() } horizontal Flattern callback hell using promise var promise =new Promise((resolve,reject)=>{ task... taskSuccess call resolve() taskFailure call reject }) promise.then(()=>{ return "pass next then" },(e)=>{ //error handling }).then((prePass)=>{ return }).catch((e)=>{ error handling... }) Vertical flattern/Normal flow using async function async function feature comes in ES7
Try to scroll this section and look at the navigation bar while scrolling! Try to scroll this section and look at the navigation bar while scrolling!
Try to scroll this section and look at the navigation bar while scrolling! Try to scroll this section and look at the navigation bar while scrolling!
Try to scroll this section and look at the navigation bar while scrolling! Try to scroll this section and look at the navigation bar while scrolling!
Try to scroll this section and look at the navigation bar while scrolling! Try to scroll this section and look at the navigation bar while scrolling!
Try to scroll this section and look at the navigation bar while scrolling! Try to scroll this section and look at the navigation bar while scrolling!
Try to scroll this section and look at the navigation bar while scrolling! Try to scroll this section and look at the navigation bar while scrolling!