We’ve made a couple of advanced uses of state of elements, one of which is a toast notification system with a reusable element. The way we’re populating the data at the moment is by adding to the state of the toast notification element using arbitary text and parsing it through regex.
So Success’s Display is the type of notification, what’s in between the &'s is the text to show, and last is a unique id for the toast notification.
How I’d do it with code is to send it as a js object looking like(though using consts for reusablity and modularity):
{
Type: “Success”,
Text: “Transcript Reverted”,
UID: uuid4(),
}
In bubble we many times use parameters to send, but it’s unavailable when we are setting states in a list that each state needs several parameters that should be coupled with each other, an option we thought of is sending three separate states but it doesn’t address the main issue, they should be grouped/coupled with each other and, if we need to, we can then modularly set each other differently. This also causes problems when we need to parse stuff that may have one of the delimiters that we use the regex to find and replace making it a risky operation to use.
Anyone has any suggestions on how we can address this to have a more reusable and modular codebase in bubble?