Asynchronous Programming Notes
Asynchronous programming
catalogue
1, EventLoop
1.JavaScript is a single threaded language
2. Synchronous and asynchronous tasks
3.EventLoop execution process
2, Promise
3, async and await
4, Macro and micro tasks
1, EventLoop
1.JavaScript is a single threaded language
Basic concepts
JavaScript is a single threaded programming ...
Posted by aboldock on Tue, 26 Oct 2021 03:43:19 -0700
Server sent events (SSE) & EventSource client use and server basic implementation (based on Node.js)
objective
The traditional Web front and back communication is mainly carried out by HTTP. Usually, the foreground actively requests to the background for what it needs, and the background cannot directly send data to the front. Usually, if the background data changes frequently, the foreground mainly depends on polling or long connection. ...
Posted by phpbeginner0120 on Mon, 25 Oct 2021 20:04:23 -0700
HTML written test front-end basic knowledge error prone questions knowledge points
Which of the following does not improve the efficiency of dom element operation: Correct answer: D uses the event agent when handling the click event of the list sub element When inserting a large number of DOM elements, use innerHTML instead of building elements one by one Use DocumentFragment instead of multiple appendChild operations Use add ...
Posted by deemurphy on Sun, 24 Oct 2021 20:52:26 -0700
Extending 2D canvas graphic interface based on QuickJS
In the field of Web technology, canvas is a widely used function, which can support developers to expand the vector graphics rendering ability in addition to the original HTML ability. It is often used to realize vector animation, particle special effects, charts, games and so on. Canvas is just a canvas in HTML. It doesn't have drawing abili ...
Posted by nephish on Sun, 24 Oct 2021 19:06:38 -0700
Uni app image lazy loading
Uni app image lazy loading
function
Lazy loading of pictures is realized, and there are always only 3 pictures in the display array. While sliding up and down to increase, the first one is deleted. You can specify which page of the total picture to load from.
thinking
To achieve the animation effect when sliding up and down, I use the swipe ...
Posted by atkman on Sun, 24 Oct 2021 18:03:54 -0700
javascript Basics (built-in objects)
1. Built in objects
There are three kinds of objects in JavaScript: custom object, built-in object and browser object The first two objects are the basic content of JS and belong to ECMAScript; The third browser object is unique to JS. JS API explains that built-in objects refer to some objects of JS language. These objects are used by devel ...
Posted by allaboutthekick on Sun, 24 Oct 2021 17:16:44 -0700
JavaScript implements dynamically added elements to add click events
In the process of page development, it is often necessary to dynamically add elements and bind related events to this element. In this case, it is generally necessary to add related attributes to the elements and then write the event functions of these elements. How do dynamically added elements bind events?
Native JavaScript
There are two ma ...
Posted by ldougherty on Sun, 24 Oct 2021 16:12:01 -0700
Introduction to JavaScript syntax
This blog is a personal self-study record. If there is any deficiency, please criticize and correct it.
Version: ES 6
The basic syntax in this chapter refers to the syntax commonly used in JS
Expressions and statements
expression
The value of the 1 + 2 expression is 3The value of the add(1,2) expression is the return value of the functio ...
Posted by cyberrate on Sun, 24 Oct 2021 12:16:11 -0700
Some thoughts and best practices on react-derived States
Derived state of React
Prior to react 16.3, the only way to update the state s inside a component when props changed was to use componentWillReceiveProps followed by a getDerivedStateFromProps.
There are two scenarios when using a derived state:
Manage a copy of the props passed by the parent component in the state of the child componen ...
Posted by macinslaw on Sun, 24 Oct 2021 09:27:00 -0700
01 Vue template syntax
an introduction to
What is Vue?
Vue (pronunciation / vju) ː/, view) is a progressive framework for building user interfacesvue's core library only focuses on view layers, which is not only easy to start, but also easy to integrate with third-party libraries or existing projects
Rendering helloworld onto a page using Vue
Directives (custo ...
Posted by Revan on Sun, 24 Oct 2021 05:31:58 -0700