-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(core): Add
tryWithConsolidated
helper (#141)
- Loading branch information
Showing
6 changed files
with
116 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
--- | ||
"@zarrita/core": minor | ||
--- | ||
|
||
feat: Add `tryWithConsolidated` store helper | ||
|
||
Provides a convenient way to open a store that may or may not have consolidated | ||
metadata. Ideal for usage senarios with known access paths, since store with | ||
consolidated metadata do not incur additional network requests when accessing | ||
underlying groups and arrays. | ||
|
||
```js | ||
import * as zarr from "zarrita"; | ||
|
||
let store = await zarr.tryWithConsolidated( | ||
new zarr.FetchStore("https://localhost:8080/data.zarr"); | ||
); | ||
|
||
// The following do not read from the store | ||
// (make network requests) if it is consolidated. | ||
let grp = await zarr.open(store, { kind: "group" }); | ||
let foo = await zarr.open(grp.resolve("foo"), { kind: "array" }); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters