Closed tirzah2 closed 1 year ago
I'd rather wait till we have a solution like maybe custom document types (if we go that route, I'm not sure at this time) to make the API easy to use, but you can already do some things if you poke around in window.clockDatabase.
This increments a clock for example:
const clock = window.clockDatabase.getName("Test a cloc");
window.clockDatabase.update({ id: clock.id, value: clock.value + 1 });
Added to the readme in case anyone else needs it. Hope that will suffice for your purpose! Next release the value of the update will be clamped, but until then you'll need to be careful not to overflow/underflow.
Hi! would it be possible to have some kind of API that allows an easy macro like i dont know.. clock.increase and clock.decrease?