Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[store][v2] "autosave" expects u64 in rust, but boolean in js #1931

Closed
bpevs opened this issue Oct 14, 2024 · 1 comment
Closed

[store][v2] "autosave" expects u64 in rust, but boolean in js #1931

bpevs opened this issue Oct 14, 2024 · 1 comment

Comments

@bpevs
Copy link

bpevs commented Oct 14, 2024

Basically, I'm not quite sure I understand what the canonical usage is supposed to look like anymore. My currently working instantiation code looks like this:

const tauriStore = await createStore('data.bin', { autoSave: 1 })

In the guest-js, the store expects a boolean for autoSave, but the bridge will throw an error for this, because on the rust-side, we actually expect an Optional u64

It seems that this is supposed to represent the autosave debounce? But it's not represented in the JS types.

Also, the docs now don't use createStore? But then this following store doesn't assigned a rid, right? The following code from the readme throws an error for me (using npm:@tauri-apps/plugin-store@^2.0.0, rust:tauri-plugin-store = "2.0.1").

const store = new Store('.settings.dat')

I wouldn't mind cleaning up the docs and types a bit if my original usage is intended. But I just don't know how I'm "supposed" to be using this plugin.

@bpevs bpevs changed the title plugin-store "autosave" expects u64 in rust, but boolean in js [store][v2] "autosave" expects u64 in rust, but boolean in js Oct 14, 2024
@bpevs
Copy link
Author

bpevs commented Oct 14, 2024

dupe of #1877
longer conversation happening there, so I'm going to close this.

@bpevs bpevs closed this as completed Oct 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant