mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-03 06:27:02 +03:00
Cleanup JS and better terser compression
This commit is contained in:
parent
058217de02
commit
ba7ed497b2
20 changed files with 247 additions and 298 deletions
|
|
@ -1,6 +1,6 @@
|
|||
var computedState = Symbol('_state');
|
||||
|
||||
ko.computed = ko.dependentObservable = function (evaluatorFunctionOrOptions, evaluatorFunctionTarget, options) {
|
||||
ko.computed = function (evaluatorFunctionOrOptions, evaluatorFunctionTarget, options) {
|
||||
if (typeof evaluatorFunctionOrOptions === "object") {
|
||||
// Single-parameter syntax - everything is on this "options" param
|
||||
options = evaluatorFunctionOrOptions;
|
||||
|
|
@ -498,7 +498,6 @@ ko.isComputed = instance => (typeof instance == 'function' && instance[protoProp
|
|||
ko.isPureComputed = instance => ko.isComputed(instance) && instance[computedState] && instance[computedState].pure;
|
||||
|
||||
ko.exportSymbol('computed', ko.computed);
|
||||
ko.exportSymbol('dependentObservable', ko.computed); // export ko.dependentObservable for backwards compatibility (1.x)
|
||||
ko.exportSymbol('isComputed', ko.isComputed);
|
||||
ko.exportSymbol('isPureComputed', ko.isPureComputed);
|
||||
ko.exportSymbol('computed.fn', computedFn);
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ ko.extenders = {
|
|||
// (2) For writable targets (observables, or writable dependent observables), we throttle *writes*
|
||||
// so the target cannot change value synchronously or faster than a certain rate
|
||||
var writeTimeoutInstance = null;
|
||||
return ko.dependentObservable({
|
||||
return ko.computed({
|
||||
'read': target,
|
||||
'write': value => {
|
||||
clearTimeout(writeTimeoutInstance);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue