Tag:Higher order

  • Single page application development summary


    This paper wants to summarize the development of spa through my one page application development experience in this year. Page development mode Usually when we develop a page, we will get a design drawing. Suppose we get such a design drawing For page development, I always follow the top-down design mode. Here, we will first […]

  • In simple terms, react and Redux (3) – Export & import, high-level components


    Export & Import Export can export functions, classes, etc. there are two export methods: Default export Named export Default export Default export does not need to specify a name, but there can only be one default export in each file //Export pure value or expression results export default 1; const a = 1; export default […]

  • React series — higher order application of Redux


    Reference: deep into react technology stack Higher order reducer High order functions refer to functions that take functions as parameters or return values. High order reducers refer to functions that take reducers as parameters or return values. In the Redux architecture, reducer is a pure function whose responsibility is to calculate a new state according […]

  • Analyze the principle of react router V5 from the source code (3)


    This article will analyze the source code of the remaining components in the react router <Redirect> Like other routing components,<Redirect>use<RouterContext.Consumer>Receiving routing data; definition<Redirect>Prop types for Redirect.propTypes = { push: PropTypes.bool, from: PropTypes.string, to: PropTypes.oneOfType([PropTypes.string, PropTypes.object]).isRequired }; <Redirect>Rendering logic for First through the incomingpushdetermine<Redirect>The way to jump ispushstillreplace: //Push is props.push, which is false by default […]

  • Front end interview classic: react core knowledge


    preface: If you want to systematically learn the front-end interview questions, it is highly recommended to browseOnline ebook(mobile version is supported and updated continuously). Features of this book: comprehensive system (covering front-end core technology points), concise and targeted (designed for interview scenes). Welcome togithubComment feedback on How does react implement keep alive? Keep alive is […]

  • A “medium use” front-end internationalization scheme, please pay attention to check


    What is front-end internationalization In short, it means to translate and switch between Chinese and English, but it is not necessary to put the whole language package in. It is just to deal with it on demand. Then how to formulate an elegant internationalization scheme needs to be studied. assemblingreact-intllibrary react-intlIt is produced by a […]

  • [source code interpretation] react Redux


    Interpretation of react Redux source code [TOC] Pre knowledge Before reading this article, please make sure you understand the following knowledge: react redux High order component React diff mechanism It doesn’t matter if you don’t know much about high-order components. You just need to know that high-order components are factory functions that receive a component […]

  • Go functional programming: higher order function


    In the process of request processing, the application will accept and process the request, and then return the response result. In this process, there are also some general functions, such as authentication, monitoring and link tracking. Many RPC frameworks will provide concepts such as middleware or interceptor to support many of the functions mentioned above […]

  • JS function arguments and application of higher order functions


    Function member – arguments Arguments: the collection of all arguments (class array object) passed in when the function is called Arguments. Callee: an attribute of arguments that points to the function itself Function name. Caller: the caller of the function. If it is called globally, the returned caller is null. Function name. Length: number of […]

  • Object oriented and functional


    Before reading, please seal the following abilities: class, closure, inheritance & polymorphism, higher-order function Now, you only know global variables and functions, and start to write a Fibonacci with cache. const cache = new Map(); const fib = n => { if (cache.has(n)) { console.log(“use cache”, n); return cache.get(n); } else { let result; if […]

  • React high level component hoc (1)


    Official document on react high level componentshttps://reactjs.org/docs/high…。 cause In the process of discussing react with a few friends before, we all thought that we were very familiar with react. When we talked about the problem of react high-level components, we couldn’t clearly explain why. On the surface, we seldom use react high-level components, but in […]

  • React high level component (2) high level component in proxy mode


    As mentioned above, the basic concepts and basic usage of react high-level components are introduced. The application of react high-level components is described below. High level component of proxy mode The returned new component directly inherits from the react. Component class. As a proxy of the incoming component, the new component renders the wrapped component […]