@tldraw/store
Advanced tools
Comparing version 3.7.0-canary.3683601e879e to 3.7.0-canary.42070cd6b6ab
@@ -56,5 +56,5 @@ "use strict"; | ||
"@tldraw/store", | ||
"3.7.0-canary.3683601e879e", | ||
"3.7.0-canary.42070cd6b6ab", | ||
"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.3683601e879e", | ||
"version": "3.7.0-canary.42070cd6b6ab", | ||
"author": { | ||
@@ -45,4 +45,4 @@ "name": "tldraw Inc.", | ||
"dependencies": { | ||
"@tldraw/state": "3.7.0-canary.3683601e879e", | ||
"@tldraw/utils": "3.7.0-canary.3683601e879e", | ||
"@tldraw/state": "3.7.0-canary.42070cd6b6ab", | ||
"@tldraw/utils": "3.7.0-canary.42070cd6b6ab", | ||
"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
791312
12821
+ Added@tldraw/state@3.7.0-canary.42070cd6b6ab(transitive)
+ Added@tldraw/utils@3.7.0-canary.42070cd6b6ab(transitive)
- Removed@tldraw/state@3.7.0-canary.3683601e879e(transitive)
- Removed@tldraw/utils@3.7.0-canary.3683601e879e(transitive)