Tag:state

  • Realization of promise source code

    Time:2021-5-11

    Promise 1、 Simple use of promise new Promise((resolve, reject) => { resolve(“ok”) }).then(data => { console.log(data) //OK }, error => { console.log(error) }) //Simplify let promise = new Promise(executor) promise.then(onFulfilled, onRejected) It should be noted that executorIs a callback function that will be executed immediately with two parameters,resolveand reject IfexecutorCalled inresolve(value)So thisvalueWill be passed on […]

  • Application of HTTP response – 302304 code

    Time:2021-5-11

    Basic structure     Description of status code     302     Results of packet capture   If the cache is not clear, visit a.php for the second time, and the result is as follows     302 status code can also jump to the Internet   304 tells the browser that the resource […]

  • Read JDK source code: asynchronous task futuretask

    Time:2021-5-11

    In Java, the runnable interface represents a task that does not return a result, while the callable interface represents a task that returns a result.In concurrent programming, executing tasks asynchronously and obtaining task results can improve the throughput of the system. Future interface emerges as the times require. It represents the execution results of asynchronous […]

  • Emacs plug in (3) — version management Magit

    Time:2021-5-10

    1、 Reference Contents of Emacs series articles — updating A walk through the Magit interface 2、 Basic use 2.1 magit status C-x gget intomagit status, similar togit status As you can see,magit statusWill display more content thangit status 2.2 hide extension tab aboutmagit statusEach part of can be usedtabKey to hide or expand the current […]

  • Five mistakes to avoid when using react hooks!

    Time:2021-5-10

    Author: ShadeedTranslator: XiaozhiSource: Dmitri pavlutin Like again, wechat search【Great Migrations 】, B station attention【Front end tips】This person has no background of a big factory, but has a positive attitude. this paperGitHub https://github.com/qq44924588…It has been included in the book, the articles have been classified, and a lot of my documents and tutorial materials have been sorted […]

  • Java thread pool: source code

    Time:2021-5-10

    preface In the last articleJava thread pool: TheoryIn this article, we have introduced what thread pool is and how to use it( The original idea of writing is to use the text, but after the netizen’s suggestion, I feel that it would be more appropriate to change it to a theoretical one. This article is […]

  • Best practice of Redux promise Middleware

    Time:2021-5-9

    Overview of Redux promise Middleware We have discussed middleware before. aboutreduxThe middleware we use to deal with asynchrony isredux-promise-middlewareCompared withredux-promiseIt retains the ability to update optimistically. After enabling it, we can trigger apayloadProperty ispromiseObjectaction const foo = () => ({ type: ‘FOO’, payload: new Promise() }) The middleware immediately triggers aaction, type is the type […]

  • The use of fragment and navigation

    Time:2021-5-8

    Introduction to fragment FragmentSince the introduction of Android 3.0, students who have just contacted will connect it with AndroidActivityCompared with the relationship between HTML fragment and HTML page, it is not accurate. The former is more about the concept of component, which requires a set of management mechanism at runtime; The latter focuses on the […]

  • Tear JS by hand (may be updated continuously)

    Time:2021-5-7

       some common ways to implement JS are frequently asked questions in the interview, and may be at a loss at the beginning. Knowing and understanding the principles can be more like a duck to water in daily development, and it is not a problem to face an interview. In addition, learn to take the […]

  • React native gets the current network state of the device Netinfo

    Time:2021-5-6

    `The ‘react native’ application can obtain the network status of the device by using the ‘Netinfo’ package. NetInfo NetInfoThe module can get the current network status of the device, and can subscribe and get the network status at one time. Previously in react native integration, now it has been separately moved [email protected] management. Install (IOS […]

  • Understand HTTP protocol, simple, direct and violent

    Time:2021-5-6

    HTTP concept HTTP (Hypertext Transfer Protocol) is an application layer transport protocol based on TCP protocol, which can be understood as a rule of data transmission between client and server. HTTP is a stateless protocol. The HTTP protocol itself does not persist the sent requests and corresponding communication states. In this way, the simplicity of […]

  • Glacier, can you talk about how to realize the unlimited expansion of MySQL data storage?

    Time:2021-5-6

    Write on the front With the rapid development of the Internet, more and more data are deposited in enterprises, which requires higher scalability of data storage layer. In today’s Internet enterprises, most enterprises use Mysql to store relational data. How to achieve the high scalability of MySQL data storage layer has become a problem that […]