-
First of all thanks for creating this great library 🙏 Similar to the question asked in #17, I was looking into a way to access a single item at startup. My use case is the following: in my app, there are several objects stored (not many, probably 10 at most with some attributes). Now what I want to provide is that when a user opens the app, the last selected object is shown. However I'm running into the problem that I noticed that the discussion was marked as solved, however I think it was mainly based on the speed improvements, not the |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 14 replies
-
Hey @batjoc! Apologies but not too sorry for the delay, I've been on vacation and wanted to really give myself a nice break. 🙂 You're right that the first access of I do think I have some potential help for you though. I've been working hard on a 2.0 releases of Boutique and Bodega, and one of the improvements is the ability to have a I can recommend using the 2.0 branch, I'm going to cut a preview release version in the next day or two. There are some minimal API breaking changes, for the purposes of creating a better overall API. The migration should be very small and I think you'll see it's not hard to implement, the reason it's a preview release and not an official release is only because is I want to document a migration path, new features, and build some walkthroughs to show people how to use Boutique and Bodega. Hope that helps, if that works lemme know how it goes, and if not lemme know if I can help otherwise! |
Beta Was this translation helpful? Give feedback.
Hey @batjoc! Apologies but not too sorry for the delay, I've been on vacation and wanted to really give myself a nice break. 🙂
You're right that the first access of
Store.items
will return[]
on startup, that's something I want to improve but I'm honestly not sure how. The issue is that there has to be a default value, and since the initial query of all the persisteditems
has to take place on the@MainActor
, there will be some non-zero initialization time when theTask
is dispatched.I do think I have some potential help for you though. I've been working hard on a 2.0 releases of Boutique and Bodega, and one of the improvements is the ability to have a
@StoredValue
type, similar to@Store
.…