package.dist.module-min.array.js Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mikado Show documentation
Show all versions of mikado Show documentation
Web's fastest template library to build user interfaces.
The newest version!
import Mikado,{apply_proxy}from"./mikado.js";const proto=Array.prototype,proxy=window.Proxy;let skip=!1;function debug(a){if(!a)throw new Error("The observable array was not assigned to a Mikado instance. You need to pass in the observable array when initiating a Mikado instance.")}export default function Observer(a){if(a instanceof Observer)return a;if(!(this instanceof Observer))return new Observer(a);!1,this.mikado=null;const b=a?a.length:0;if(proxy){if(b)for(let c=0;c=d?(e.add(c),a.length++):ba.length&&this.splice(a.length)):(this.splice(),this.concat(a)),this},Observer.prototype.splice=function(a,b,c){!1,!1,skip=!0,a||(a=0),"undefined"==typeof b&&(b=this.length-a,0>b&&(b=0)),b&&this.mikado.remove(a,b);const d=c?this.proto.splice(a,b,c):this.proto.splice(a,b);return c&&this.mikado.add(c,a),skip=!1,d},Observer.prototype.push=function(a){!1,!1,skip=!0,this.mikado.add(a),this[this.length]=a,proxy&&this.length++,skip=!1},Observer.prototype.unshift=function(a){!1,!1,skip=!0,this.mikado.add(a,0),this.proto.unshift(a),skip=!1},Observer.prototype.pop=function(){!1,!1,skip=!0,this.mikado.remove(this.length-1);const a=this.proto.pop();return skip=!1,a},Observer.prototype.shift=function(){!1,!1,skip=!0,this.mikado.remove(0);const a=this.proto.shift();return skip=!1,a},Observer.prototype.concat=function(a){const b=a.length;for(let c=0;c
© 2015 - 2025 Weber Informatics LLC | Privacy Policy