Is there a way to attach an object on the EditorState instance? We created multiple states for a single editor view and need to store some variable values on each state accordingly. Is that possible?
I tried to following way but it always got overwritten.
@marijn
Thanks for quick response! I tried stateFields but it works like computed property. my problem is that I want to store some variables for each state. See code below, if i do this, how can i find the statefield for each state?
What i want to implement is to access some unique information for each state. But i couldn’t find a way to store it along with each state. can this be done via statefield?
If the value stays the same as the state gets updated through transactions, a facet might be more convenient. If it doesn’t, you can use StateField.init to give a field a custom initial value.