3 ms·
For primitive types, serde isn't hard. It could even be part of a simple spec. Numbers, Dates, String[], Number[], Date[]. Edit: Or it could just be JSON. For
by berkes 3y ago
For primitive types, serde isn't hard. It could even be part of a simple spec. Numbers, Dates, String[], Number[], Date[]. Edit: Or it could just be JSON.
For complex types it is. But why and when do you need to store complex types in the DOM? Isn't that always a bad idea?
I'm a seasoned web dev, but haven't been working on complex frontend apps, because I believe complexity and frontend web don't go together. So I may very well miss some use-cases.
- bryancoxwell 3y agoFor custom elements you may want to store data or methods that modify the element’s behavior.
- berkes 3y agoMethods as in callbacks? So, code? Do you then store a closure or such? Or a pointer to one (i.e. the function/name)? And how or what data would modify behaviour? As said: I'm unfamiliar with these concepts as I actively try to avoid them :)