You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was experiencing this issue (.getItem is not a function). My mistake was assuming that .localStorage("id") retrieved a "channel" object of some type that setItem and getItem could be used on. What it actually does is set the localstorage ID for the entire vorpal instance.
Doesn't work:
...
vorpal.localStorage("test").getItem("t")
> TypeError: vorpal.localStorage(...).getItem is not a function
If you look at the src of the localStorage function:
when called it extends the localStorage instance but returns the vorpal instance, meaning that to make that one-liner work, you'd need to access localStorage again after calling it as a function:
Not just returning the localStorage instance is unintuitive for this specific use case, so I assume the function is meant to be used in a setup chain like so:
vorpal.localstorage has wrong type on the instance. It does not have setItem and getItem
The text was updated successfully, but these errors were encountered: