Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions reflex-indexed-db.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ test-suite reflex-indexdb-test
hs-source-dirs: test
main-is: Spec.hs
build-depends: base
, aeson
, ghcjs-dom
, reflex-indexed-db
, reflex-dom
Expand Down
2 changes: 1 addition & 1 deletion src/Reflex/IDB.hs
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ currentUpdate item = Cursor $ liftF $ OpCurUpdate item ()
currentDelete :: (Monad m) => Cursor t s m ()
currentDelete = Cursor $ liftF $ OpCurDelete ()

type Item = Text
type Item = A.Value

newtype Cursor t s m a = Cursor { runCursor :: FreeT (CursorOp t Item) (ExceptT IDBError (StateT s m)) a}
deriving ( Functor
Expand Down
5 changes: 3 additions & 2 deletions test/Spec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import Reflex.IDB
import Reflex.Dom
import qualified Data.Aeson as A
import qualified Data.Text as T
import Control.Monad.IO.Class
import qualified GHCJS.DOM.Enums as DOM
Expand All @@ -23,8 +24,8 @@ testIDB = mainWidget $ do
tres <- runTransaction idb (TransactionConfig ["todo"] DOM.IDBTransactionModeReadwrite todoAddE never) $ do
todoSt <- openStore "todo"
inp <- getInput
add todoSt (T.pack "testV") (Just $ inp)
add todoSt (T.pack "testV") (Just $ inp <> "_1")
add todoSt (A.String "testV") (Just $ inp)
add todoSt (A.object ["name" A..= T.pack "byteally"]) (Just $ inp <> "_1")
liftIO $ print inp
return ()
text "Is DB Open: "
Expand Down