@tldraw/store
Advanced tools
Comparing version 3.7.0-canary.624a5454ff90 to 3.7.0-canary.637edd28cb93
@@ -56,5 +56,5 @@ "use strict"; | ||
"@tldraw/store", | ||
"3.7.0-canary.624a5454ff90", | ||
"3.7.0-canary.637edd28cb93", | ||
"cjs" | ||
); | ||
//# sourceMappingURL=index.js.map |
@@ -274,11 +274,18 @@ "use strict"; | ||
const ids = this.ids(typeName, queryCreator, "ids:" + name); | ||
return (0, import_state.computed)(name, () => { | ||
return [...ids.get()].map((id) => { | ||
const atom = this.atoms.get()[id]; | ||
if (!atom) { | ||
throw new Error("no atom found for record id: " + id); | ||
} | ||
return atom.get(); | ||
}); | ||
}); | ||
return (0, import_state.computed)( | ||
name, | ||
() => { | ||
const atoms = this.atoms.get(); | ||
return [...ids.get()].map((id) => { | ||
const atom = atoms[id]; | ||
if (!atom) { | ||
throw new Error("no atom found for record id: " + id); | ||
} | ||
return atom.get(); | ||
}); | ||
}, | ||
{ | ||
isEqual: import_utils.areArraysShallowEqual | ||
} | ||
); | ||
} | ||
@@ -285,0 +292,0 @@ /** |
{ | ||
"name": "@tldraw/store", | ||
"description": "A tiny little drawing app (store).", | ||
"version": "3.7.0-canary.624a5454ff90", | ||
"version": "3.7.0-canary.637edd28cb93", | ||
"author": { | ||
@@ -45,4 +45,4 @@ "name": "tldraw Inc.", | ||
"dependencies": { | ||
"@tldraw/state": "3.7.0-canary.624a5454ff90", | ||
"@tldraw/utils": "3.7.0-canary.624a5454ff90", | ||
"@tldraw/state": "3.7.0-canary.637edd28cb93", | ||
"@tldraw/utils": "3.7.0-canary.637edd28cb93", | ||
"lodash.isequal": "^4.5.0" | ||
@@ -49,0 +49,0 @@ }, |
@@ -10,3 +10,3 @@ import { | ||
} from '@tldraw/state' | ||
import { objectMapValues } from '@tldraw/utils' | ||
import { areArraysShallowEqual, objectMapValues } from '@tldraw/utils' | ||
import isEqual from 'lodash.isequal' | ||
@@ -337,11 +337,18 @@ import { IdOf, UnknownRecord } from './BaseRecord' | ||
return computed<S[]>(name, () => { | ||
return [...ids.get()].map((id) => { | ||
const atom = this.atoms.get()[id] | ||
if (!atom) { | ||
throw new Error('no atom found for record id: ' + id) | ||
} | ||
return atom.get() as S | ||
}) | ||
}) | ||
return computed<S[]>( | ||
name, | ||
() => { | ||
const atoms = this.atoms.get() | ||
return [...ids.get()].map((id) => { | ||
const atom = atoms[id] | ||
if (!atom) { | ||
throw new Error('no atom found for record id: ' + id) | ||
} | ||
return atom.get() as S | ||
}) | ||
}, | ||
{ | ||
isEqual: areArraysShallowEqual, | ||
} | ||
) | ||
} | ||
@@ -348,0 +355,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
791312
12821
+ Added@tldraw/state@3.7.0-canary.637edd28cb93(transitive)
+ Added@tldraw/utils@3.7.0-canary.637edd28cb93(transitive)
- Removed@tldraw/state@3.7.0-canary.624a5454ff90(transitive)
- Removed@tldraw/utils@3.7.0-canary.624a5454ff90(transitive)