Skip to content

Commit 96f7a95

Browse files
committed
Add IIndexed protocol
1 parent 1f4f900 commit 96f7a95

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/mori.cljs

+7
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,12 @@
331331
IHash
332332
(-hash [this] (.call (aget methods "hash") this))))
333333

334+
(defn extend-to-iindexed [obj methods]
335+
(specify! obj
336+
IIndexed
337+
(-nth [this k] (.call (aget methods "nth") this))
338+
(-nth [this k not-found] (.call (aget methods "nth") this))))
339+
334340
(defn extend-to-ikvreduce [obj methods]
335341
(specify! obj
336342
IKVReduce
@@ -368,6 +374,7 @@
368374
"IEncodeJS" (extend-to-iencodejs obj methods)
369375
"IEquiv" (extend-to-iequiv obj methods)
370376
"IHash" (extend-to-ihash obj methods)
377+
"IIndexed" (extend-to-iindexed obj methods)
371378
"IKVReduce" (extend-to-ikvreduce obj methods)
372379
"ILookup" (extend-to-ilookup obj methods)
373380
"IMap" (extend-to-imap obj methods)

0 commit comments

Comments
 (0)