-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No protocol method IWithMeta.-with-meta defined #28
Comments
Cursors, like other "ref"s should support |
Thanks Aaron. For an app I am building, it is very useful to track a cursor's parent iref and the key sequence. I was able to implement a helper fn to accomplish this using
|
Do you think this is important enough to put into core? I'm thinking something like this: (defn cursor* [ref korks-or-getter setter lazy]
(let [ks (cond
(keyword? korks-or-getter)
[korks-or-getter]
(sequential? korks-or-getter)
korks-or-getter)
...
cursor (ReactiveCursor. ref getter setter true nil nil nil nil lazy nil nil)]
...
(when ks
(let [{:keys [root path]} (meta ref)
path-info (if (and root path)
{:root root :path (concat path ks)}
{:root ref :path ks})]
(alter-meta! cursor merge path-info)))
cursor)) That would capture the path back to the root if available. What do you think? |
I have created a cursor using with-meta:
Attempting to use the cursor throws this exception:
It would be great to be able to have metadata on cursors.
Thanks!
The text was updated successfully, but these errors were encountered: