Data flow scheme of transforming old project with dva

Preface Recently, I had some trouble transferring my scaffolding project to TypeScript. Before the project, the system of react + react Redux + Redux thunk + Redux actions + Redux promise was adopted. When a project is converted to TypeScript, react and react Redux are perfect conversions. Redux actions transformation is also initially complete ...

Posted by TonyB on Fri, 13 Dec 2019 04:46:57 -0800

Record the charging points of AJAX

First of all, what is AJAX? AJAX = asynchronous JavaScript and XML. AJAX is a technology for creating fast dynamic web pages. AJAX enables web pages to be updated asynchronously by exchanging a small amount of data with the server in the background. This means that a part of the page can be updated without reloading the entire page. Traditional ...

Posted by dinger on Fri, 13 Dec 2019 00:46:48 -0800

wap2app -- add guide page

1. Add the following code to the client_index.html file: <script type="text/javascript"> if(window.plus){ plusReady() }else{ document.addEventListener('plusready',plusReady,false) } function plusReady(){//Here is the guide page displayed every time you enter the application. How to ...

Posted by phpgeek17 on Thu, 12 Dec 2019 13:12:55 -0800

Record of rare writing method of react

function App1() { return <Greeting firstName="Ben" lastName="Hector" />; } function App2() { const props = {firstName: 'Ben', lastName: 'Hector'}; return <Greeting {...props} />; } <MyComponent message="&lt;3" /> <MyComponent message={'<3'} /> <MyComponent message="hello world" /> ...

Posted by duny on Thu, 12 Dec 2019 08:01:18 -0800

GridManager format data

GridManager When processing data, it is necessary to use the specified data format. In the actual scene, there are some format differences more or less. How to deal with these differences will be explained here 1. Only return field name is inconsistent Data and totals in the primary data can be adjusted by using dataKey and totalsKey. The back- ...

Posted by xray_griff on Thu, 12 Dec 2019 06:16:29 -0800

Node learning note function self calling and crud addition, deletion, modification and query

Function self calling In general, the purpose of taking a function as a parameter is to obtain the asynchronous operation results inside the function The following code is an example of synchronization function add (x + y) { // Function method return x + y } add(10, 20) // Calling function The following code is an asynchronous function ...

Posted by utdfederation on Thu, 12 Dec 2019 00:54:57 -0800

d3.js selection.data([values[, key]]) source code parsing

Preface Recently, I was learning d3.js. At the beginning of the selector section, there was a selection.data method. It was found that the second parameter of this method can be passed or not, and the second parameter is a function. However, there is no explanation of the usage of the second parameter in the document, so it is difficult to find ...

Posted by sonoton345 on Wed, 11 Dec 2019 23:33:47 -0800

About javascript Object. hasOwnProperty, it's enough for me

Basic concepts of hasOwnProperty The hasOwnProperty() method returns a Boolean value indicating whether the specified property exists in the object's own property (non inherited property),If the object has a property with the specified name, the hasOwnProperty method returns true, otherwise false. This method does not check properties in the ob ...

Posted by dashti on Wed, 11 Dec 2019 13:06:05 -0800

How to randomize (randomly play) JavaScript arrays?

I have an array like this: var arr1 = ["a", "b", "c", "d"]; How to play randomly? #1 building A person can (or should) use it as an Array prototype: From ChristopheD: Array.prototype.shuffle = function() { var i = this.length, j, temp; if ( i == 0 ) return this; while ( --i ) { j = Math.floor( Math.random() * ( i + 1 ...

Posted by jinwu on Wed, 11 Dec 2019 12:46:31 -0800

JavaScript monitors the change of input median in real time

Code Method 1: <!DOCTYPE html> <html> <head> <script src="http://libs.baidu.com/jquery/1.10.2/jquery.min.js"></script> <title>test</title> </head> <body> <input class="et-name" type="input" name="name"> <script type="text/javascript"> $(funct ...

Posted by mickwaffle on Wed, 11 Dec 2019 09:13:52 -0800