Closed ilan-deepreach closed 4 years ago
Hello. This is by design.
To solve your problem you can create that array every time for every new object instance.
stampit({
init() {
this.a = [];
}
});
Or, better, in this case use the deepProps
:
stampit({
deepProps: []
});
The props
are always copied by reference. That's by design. (Same as in classes.)
Whereas the deepProps
are always (deeply) cloned.
what's logged is [1] then [1, 1] then [1, 1, 1] I expect [1] consistently. Why would props be shared between objects that are instance of stamps.