Understanding toggleMark and storedMarks

I am having a problem understanding when the storedMarkes will be removed from the editor state. My use case is that I want to unit test that my mark will be correctly applied when having a cursor selection. I am using the toggleMark command and everything works but I am wondering when I remove my mark the storedMarks is an array of length 0 instead of undefined like it usually is when there are no storedMarks. Is this a bug?

Toggle mark on Screen Shot 2020-04-13 at 3.24.24 PM

Toggle mark off Screen Shot 2020-04-13 at 3.24.43 PM

No, that’s intentional. storedMarks: null means “don’t do anything special for the next insertion”, whereas storedMarks: [] means “make sure the next insertion doesn’t have any marks set”.

Makes sense. Thanks for the quick reply.