Lexi in the GunDB chat suggested renaming then() to next() to avoid confusion with the async API's. That makes sense to me so I've pushed the change and updated the API docs.
To update examples from previous posts, that means Holster queries now look like:
holster.get("hello").next("world!").on(console.log)
// Which will get called by this update.
holster.get("hello").next("world!").put("update", console.log)
Now all I need to use Holster in a real application is to add SEA from GunDB. No idea how that's going to happen... wish me luck!
IndexedDB
Another item on the TODO list ticked off, IndexedDB is now working in the browser by using Holster({indexedDB: true}). Thankfully the GunDB code was pretty easy to re-use for this! I've kept it opt-in to use browser storage, as Holster currently works fine with server only storage and I'd like to keep both working.
I also missed an update to the examples folder I could've made earlier. It previously didn't try to run both Holster API updates at the same time due to the shared context, but now that's working it's fine to make the two updates occur at random times similar to wire.js. The main difference now being that index.js doesn't set state values on properties, so the value that is fetched at the end is whichever update happened last.
Next
then()
tonext()
to avoid confusion with the async API's. That makes sense to me so I've pushed the change and updated the API docs.To update examples from previous posts, that means Holster queries now look like: Now all I need to use Holster in a real application is to add SEA from GunDB. No idea how that's going to happen... wish me luck!
IndexedDB
Holster({indexedDB: true})
. Thankfully the GunDB code was pretty easy to re-use for this! I've kept it opt-in to use browser storage, as Holster currently works fine with server only storage and I'd like to keep both working.I also missed an update to the examples folder I could've made earlier. It previously didn't try to run both Holster API updates at the same time due to the shared context, but now that's working it's fine to make the two updates occur at random times similar to
wire.js
. The main difference now being thatindex.js
doesn't set state values on properties, so the value that is fetched at the end is whichever update happened last.