mirror of
https://github.com/ilyakooo0/purescript-indexedDB.git
synced 2024-09-11 06:55:48 +03:00
add IDBKey instance to Key
This commit is contained in:
parent
ea5183dcc7
commit
302a9f31af
@ -88,6 +88,12 @@ instance showKey :: Show Key where
|
||||
either (const "(Key)") (\s -> "(Key " <> s <> ")") x
|
||||
|
||||
|
||||
instance idbKeyKey :: IDBKey Key where
|
||||
toKey = id
|
||||
fromKey = pure
|
||||
unsafeFromKey = id
|
||||
|
||||
|
||||
instance idbKeyInt :: IDBKey Int where
|
||||
toKey = Foreign.toForeign >>> Key
|
||||
fromKey (Key f) = Foreign.readInt f
|
||||
|
Loading…
Reference in New Issue
Block a user