asasvirtuais 2.2.6 → 2.2.7
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/package.json
CHANGED
|
@@ -269,16 +269,14 @@ export function useSingleProvider<TSchema extends TableSchema>({
|
|
|
269
269
|
}) {
|
|
270
270
|
const { find, index } = useTable(table, schema)
|
|
271
271
|
const [single, setSingle] = useState<z.infer<TSchema['readable']>>(
|
|
272
|
-
|
|
273
|
-
() => index[table][id]
|
|
272
|
+
() => index[id]
|
|
274
273
|
)
|
|
275
274
|
useEffect(() => {
|
|
276
275
|
if (!single) find.trigger({ id }).then(setSingle)
|
|
277
276
|
}, [])
|
|
278
277
|
useEffect(() => {
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
}, [index[table][id as keyof typeof index]])
|
|
278
|
+
setSingle(index[id])
|
|
279
|
+
}, [index[id]])
|
|
282
280
|
return {
|
|
283
281
|
id,
|
|
284
282
|
single,
|