Tag:Infernal

  • How deep is flutter nested? Expand the function to understand

    Time:2020-11-18

    background The deep nesting problem bothers many students who have just come into contact with flutter. It not only seems uncomfortable, but also greatly affects the coding experience. The big guys will tell you that you shouldSplit your own nested code(Custom widget or extract build method)To reduce nesting levels. This is really an effective method. […]

  • Promise: from blindness to luminescence (2) – promise basis

    Time:2020-11-13

    Basic use of promise //1. Create a new promise object //1. Create a new promise object Const P = new promise ((resolve, reject) = > {// actuator function synchronization callback console.log (‘execute executor ‘) //2. Execute asynchronous operation task setTimeout(() => { const time = Date.now() //3.1. If successful, call resolve (value) if (time % […]

  • “Call back to hell”: promise example of elegant solution

    Time:2020-11-6

    What is “callback hell” ”Callback hell “is also called” callback pyramid “. When we write code, it is inevitable for JS to call back asynchronouslyFor example, AJAX continues to request data asynchronously, and the callback method also needs to process the data and continue to callback… Forming a callback hellThis will make our code readability […]

  • What problems does promise solve

    Time:2020-9-11

    What problems does promise solve 1PromiseProblem solved Back to hell readability issues Trust problem (also known as inversion of control problem) 2、 Back to hell What is callback hell? In my opinion, asynchronous nesting can be calledBack to hellTake a chestnut //Querydata requests data from the back end queryData(‘data1’, function(ret) { console.log(ret);   queryData(‘data2’, function(ret) { […]

  • Know and use promise

    Time:2020-8-12

    Promise is an object returned by an asynchronous operation to pass messages from an asynchronous operation. Problems that can be solved: Solve the problem of callback hell, which will not lead to difficult maintenance; Merging multiple asynchronous requests saves time. Promise has three states: Initial state of pending promise object instance creation; The status when […]

  • Promise from two blind eyes to binocular light (2) – promise basis

    Time:2020-5-27

    Basic use of promise //1. Create a new promise object //1. Create a new promise object Const P = new promise ((resolve, reject) = > console.log (‘execute executor’) //2. Perform asynchronous operation task setTimeout(() => { const time = Date.now() //3.1. If successful, call resolve (value) if (time % 2 == 0) { Resolve (‘successful […]

  • What problem does promise solve?

    Time:2020-4-3

    My GitHub blog https://github.com/zhangxingua/blog We all know that promise solves the problem of callback to hell. When it comes to callback hell, it’s easy to think of the followingMisleading pictures: But what is hell? What’s wrong with it? Is it because nesting doesn’t look good or it’s inconvenient to read? First of all, let’s think […]

  • How to solve the callback hell of render props

    Time:2020-2-25

    By Dmitri pavlutinTranslator: front-end witSource: Dmitri pavlutin Take a look at it and get used to it This paperGitHubHttps://github.com/qq44924588… Has included more categories of previous high praise articles, as well as a lot of my documents and tutorial materials. Welcome to star and perfect, you can refer to the interview site review, hope we have […]

  • Node.js asynchronous programming evolution

    Time:2020-1-24

    This article uses the “signature 4.0 International (CC by 4.0)” license agreement. You are welcome to reprint or modify it, but you need to indicate the source. Signature 4.0 International (CC by 4.0) Node.js asynchronous programming callback As we know, there are two event handling methods in node.js, namelycallback(callback) andEventEmitter(event emitter). The first part of […]