Today I think of an important improvement to virtual DOM: You can use higher-order functions to pre-evaluate diff and patch, which avoids running time to diff and patch the view, so performance is greatly optimized
Taiji Live 2014/12/14 9:32:43
It's like calculus.
Taiji Live 2014/12/14 9:33:46
The differential function is the first order function of the original function
9:35:49
Taiji Live 2014/12/14 9:35:49
View is the initial state continuous based on diff application Patch, that is, integral
Taiji Live 2014/12/14 9:36:49
The view function is restored by seeking the differential and then integrating the first.
Taiji Live 2014/12/14 9:37:20
Identities
9:44:00
Inch log
2014/12/14 9:44:00
It's so, I don't know how it's going to happen
9:46:30
Taiji Live 2014/12/14 9:46:30
First let the view function be slightly
Taiji Live 2014/12/14 9:47:14
such as constant function, linear function
Taiji Live 2014/12/14 9:48:14
The differential of the combined function of these functions is then asked
9:48:48
Taiji Live 2014/12/14 9:48:48
Like If,for,repeat.
Taiji Live 2014/12/14 9:50:34
If you can't pre-evaluate it, you're fallback to the way it is.
9:51:22
Taiji Live 2014/12/14 9:51:22
You can also leverage the caching mechanism
Taiji Live 2014/12/14 9:53:06
The differential of the constant function is 0, and the patch is the empty operation
9:55:31
Taiji Live 2014/12/14 9:55:31
{{x}} is equivalent to a linear function, the patch is to add the difference, the actual operation with the new value update is possible
9:57:14
Taiji Live 2014/12/14 9:57:14
If the test value is not changed, the patch is empty, otherwise the existing branch is replaced with another branch
Taiji Live 2014/12/14 9:58:40
Repeat is based on the model value of the increase and deletion
11:01:51
Sune
2014/12/14 11:01:51
Taiji Real
Virutal Dom Patch