- Briefly, it takes two arrays: (the string constants ) and (the templated string values that need to be encoded ).
- It is passed an array of strings, but what I’m calling an array of values, is actually a variable number of arguments.
- I’m using ES6 “rest” syntax to convert the arguments into an array of values.
- When we reduce over strings, the zeroth element of the strings array is passed as partialUri and iteration starts with the first element, and so on.
- It’s a special form of the ES6 template literal that we used above, but it allows us to process it with a function.
A while back while writing a React application that hit a REST endpoint, I wrote a little utility to build a properly encoded Uri path. At the time, I didn’t think much about it. It did the job and I moved on.
- While the tool is open source, the decision to provide no configuration options in the tool might upset some people.
- By removing configuration needs and cutting down the dependencies, this tool could prove to be useful for experienced as well as novice developers.
- Making things streamlined, the new tool brings you to the world of command line.
Read the full article, click here.
@PlPro4u: “#PHP #Python Facebook’s New Open Source Project Helps You Create Apps Easily With React.js”
Facebook’s New Open Source Project Helps You Create Apps Easily With React.js