Skip to content

Add IndexedDB and web-sys example to examples/ and guide #441

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

Closed
2 tasks
fitzgen opened this issue Jul 10, 2018 · 4 comments
Closed
2 tasks

Add IndexedDB and web-sys example to examples/ and guide #441

fitzgen opened this issue Jul 10, 2018 · 4 comments
Labels
help wanted We could use some help fixing this issue! web-sys Issues related to the `web-sys` crate

Comments

@fitzgen
Copy link
Member

fitzgen commented Jul 10, 2018

General info on IndexedDB: https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API

  • Add an example to examples/ that shows off working with IndexedDB
  • Add a subsection to "web-sys >> examples" in the guide that includes this example
@fitzgen fitzgen added help wanted We could use some help fixing this issue! web-sys Issues related to the `web-sys` crate labels Jul 10, 2018
@fitzgen fitzgen changed the title Add IndexedDB support to web-sys Add IndexedDB+web-sys example to examples/ and guide Sep 12, 2018
@fitzgen fitzgen changed the title Add IndexedDB+web-sys example to examples/ and guide Add IndexedDB and web-sys example to examples/ and guide Sep 12, 2018
@alexcrichton
Copy link
Contributor

I"m gonna close this in favor of rustwasm/gloo#68 because I think IndexedDB is more likely to be covered by gloo rather than wasm-bindgen examples

@indolering
Copy link

@alexandrestein rustwasm/gloo#68 has been closed and won't be implemented.

@Pauan
Copy link
Contributor

Pauan commented Apr 1, 2020

@indolering We still plan to add an API for IndexedDB, though probably not that specific API.

@datdinhquoc
Copy link

datdinhquoc commented Jun 13, 2021

Please, examples for IndexedDB in web-sys, I can't get it working.

Got the IdbDatabase, got IdbObjectStore, but failed to add a doc:

// The store is already in db with key id, autoIncremental
myStore.add(&JsValue::from_str("{test:1}")).unwrap();

Failed at '.unwrap()', although it's a Result.

Error in browser console:

Uncaught RuntimeError: unreachable
...
at _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h12d73e1d41de1f27
at __wbg_adapter_20

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted We could use some help fixing this issue! web-sys Issues related to the `web-sys` crate
Projects
None yet
Development

No branches or pull requests

5 participants