@solidjs/signals 2.0.0-beta.11 → 2.0.0-beta.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/dev.js CHANGED
@@ -3967,7 +3967,8 @@ function mapArray(list, map, options) {
3967
3967
  _nodes: [],
3968
3968
  _key: keyFn,
3969
3969
  _rows: keyFn || options?.keyed === false ? [] : undefined,
3970
- _indexes: indexes ? [] : undefined,
3970
+ _indexes: indexes && options?.keyed !== false ? [] : undefined,
3971
+ _byIndex: options?.keyed === false,
3971
3972
  _fallback: options?.fallback
3972
3973
  };
3973
3974
  const node = computed(updateKeyedMap.bind(data));
@@ -3984,23 +3985,28 @@ function updateKeyedMap() {
3984
3985
  let i,
3985
3986
  j,
3986
3987
  mapper = this._rows
3987
- ? () => {
3988
- this._rows[j] = signal(newItems[j], pureOptions);
3989
- this._indexes && (this._indexes[j] = signal(j, pureOptions));
3990
- return this._map(
3991
- accessor(this._rows[j]),
3992
- this._indexes ? accessor(this._indexes[j]) : undefined
3993
- );
3994
- }
3988
+ ? this._byIndex
3989
+ ? () => {
3990
+ this._rows[j] = signal(newItems[j], pureOptions);
3991
+ return this._map(accessor(this._rows[j]), j);
3992
+ }
3993
+ : () => {
3994
+ this._rows[j] = signal(newItems[j], pureOptions);
3995
+ this._indexes && (this._indexes[j] = signal(j, pureOptions));
3996
+ return this._map(
3997
+ accessor(this._rows[j]),
3998
+ this._indexes ? accessor(this._indexes[j]) : undefined
3999
+ );
4000
+ }
3995
4001
  : this._indexes
3996
4002
  ? () => {
3997
4003
  const item = newItems[j];
3998
4004
  this._indexes[j] = signal(j, pureOptions);
3999
- return this._map(() => item, accessor(this._indexes[j]));
4005
+ return this._map(item, accessor(this._indexes[j]));
4000
4006
  }
4001
4007
  : () => {
4002
4008
  const item = newItems[j];
4003
- return this._map(() => item);
4009
+ return this._map(item);
4004
4010
  };
4005
4011
  if (newLen === 0) {
4006
4012
  if (this._len !== 0) {