Serializing string-store result inside another schema
I'm trying to re-work customId serialization in my framework, and my plan is to use
string-store
for this. One of the features in my framework is that you can make customIds that refer to commands, kind of like this:
The serializer and the router in the command manager then work together to properly route interactions to the #executeComponent()
method.
My problem comes from how to implement string-store
's serialization for this. My main idea was to do something like this (on #execute()
):
#executeComponent()
would then accept an extra, optional parameter, which would be the user-provided data as a string, resolved from the customId.
The way this would work is by making the customIdSerializer have a schema with a store like this:
The advantage of this is that the user isn't forced to use string-store
, they can just pass anything and they'll receive it back.
But then if they do use string-store, the user would be serializing the string, and then the framework would be serializing it again, and I wonder if that could cause issues (from my poor testing it doesn't look like it but I'm pretty much nobody compared to the actual maintainers, maybe there's edge cases). Maybe I'm overthinking it and there's a better way?1 Reply
@kyra