Skip to main content
Sunyatasattva's user avatar
Sunyatasattva's user avatar
Sunyatasattva's user avatar
Sunyatasattva
  • Member for 11 years, 9 months
  • Last seen more than 1 year ago
  • Italy
awarded
awarded
comment
Patterns to allow for versatile data-flow hooks in Javascript
Thanks for clarifying and forgive me if I used an incorrect terminology. As you said, however, the term hook is used in a variety of ways de facto, and I decided to use this word just because the way WordPress (and other CMSes) use it, it's basically my goal. I think I might have incorrectly explained my goal. Instead of adding on a comment, I'd be grateful if you'd check out my Question Edit.
revised
Patterns to allow for versatile data-flow hooks in Javascript
Added more examples and clarified the question
Loading…
comment
Patterns to allow for versatile data-flow hooks in Javascript
Thanks for the answer, it was a nice read; however, this deals mostly with the first part of my question: event-systems as hooks. The thing with events is that the code that triggers them rightly doesn't care of who is subscribed; as such, events don't return values that can be passed around and manipulated. In my case, I need a way for other parts of the components to "filter" around specific data exposed by a specific component. As far as I know, this is specifically not allowed inRedux for good reasons. That's why I was also asking for an alternative, since this may be an anti-pattern.
Loading…
awarded
comment
Storing in-text metadata in a discrete data structure
Also, how would you go and approach the fact of binding the comment to an offset-range instead of a precise point? Last but not least: the data allocation table and transactional update queue seem amazing concepts. I did some research about the topics, but could you elaborate a bit on how you would go and implement those concepts in this architecture problem?
comment
Storing in-text metadata in a discrete data structure
First of all, I must say that I liked the enthusiasm in the answer, it was great to hear such good feedback. As for the answer itself, I must say that I would be against same syntax for opening and closing the tags; and perhaps, to avoid the XML problem I described above in my most recent update, I would specify what's being opened and what's being closed in the tag itself; perhaps like so: >>>>>(#1) Lorem ipsum (#1)>>>>>>. Also, it seems like your approach in intext comments would have them bind to a certain fixed position, how would that work if the offset is moved?
comment
Storing in-text metadata in a discrete data structure
What is in your opinion the pro of not adding a closure tag but working with offsets? Isn't it too risky? What if I add a word between nonummy and nibh, wouldn't it mess up with my offsets?
comment
Storing in-text metadata in a discrete data structure
I think a problem is that, as far as I know, in XML any element which happens to be inside another is considered child of the element, and overlapping of tags is not possible (i.e., you have to close the children before closing the parent). In my case there is no such hierarchical structure, as two notes can certainly overlap (added example at the end of my answer).
revised
Storing in-text metadata in a discrete data structure
Added a few problems about adopting XML
Loading…
awarded
awarded
comment
Storing in-text metadata in a discrete data structure
I would say that right now my practical concert is over a static and unchanging text. However, thinking ahead, I would most possibly like an architecture in which I am not bound by this decision, and implementing the changing of the text would not need a complete rewrite (of course it might need loads of work anyways). The metadata should stay for the revisions, but should stay reasonably glued to the position in the text (I would say to particular words and sentences).
awarded
comment
Storing in-text metadata in a discrete data structure
I elaborated a bit on this in my new edit.
revised
Storing in-text metadata in a discrete data structure
Added another example case for separation of data and metadata
Loading…
comment
Storing in-text metadata in a discrete data structure
What other detail do you reckon are missing from my question to give you a clear picture?
comment
Storing in-text metadata in a discrete data structure
Let's add another case that makes any use of any metadata inside the data solution useless: I want to make it possible for a single text to have metadata from different users, which may (or may not), be able to see other users' metadata.