diff --git a/src/Common b/src/Common index d399e10..2d5c169 160000 --- a/src/Common +++ b/src/Common @@ -1 +1 @@ -Subproject commit d399e10ecb5342c405dbe23e570c7200ef951b9d +Subproject commit 2d5c169087d67f2444a5d231f44dcf90bae43054 diff --git a/src/Component/Search.hs b/src/Component/Search.hs index 3b5818a..e29e69b 100644 --- a/src/Component/Search.hs +++ b/src/Component/Search.hs @@ -26,13 +26,22 @@ import Miso , consoleLog , noEff ) -import Data.JSString (pack) +import Data.JSString (JSString, pack) import qualified Network.Client as Client import Network.Http (HttpResult (..)) import Control.Concurrent.MVar (tryTakeMVar, takeMVar, putMVar, swapMVar) +import Common.Network.CatalogPostType (CatalogPost) import Common.Component.Search.SearchTypes + +data Interface a = Interface + { passAction :: Action -> a + , clientIface :: Client.Interface a [ CatalogPost ] + , searchResults :: JSString -> a + } + + update :: Interface a -> Action -> Model -> Effect a Model update iface (SearchChange q) model = model { searchTerm = q } <# do consoleLog $ "SearchChange " <> q diff --git a/src/Network/Client.hs b/src/Network/Client.hs index 5b3d76c..89c9c2c 100644 --- a/src/Network/Client.hs +++ b/src/Network/Client.hs @@ -34,6 +34,10 @@ import Network.SiteType (Site) import qualified Common.FrontEnd.Action as A import Common.Network.ClientTypes +data Interface a b = Interface + { passAction :: Action b -> a + , returnResult :: Http.HttpResult b -> a + } update :: Interface a b