Move back Interface definitions for Network.Client and Search components
- these were in the common submodule
This commit is contained in:
parent
059bc1b5d9
commit
4fd5702b27
|
@ -1 +1 @@
|
||||||
Subproject commit d399e10ecb5342c405dbe23e570c7200ef951b9d
|
Subproject commit 2d5c169087d67f2444a5d231f44dcf90bae43054
|
|
@ -26,13 +26,22 @@ import Miso
|
||||||
, consoleLog
|
, consoleLog
|
||||||
, noEff
|
, noEff
|
||||||
)
|
)
|
||||||
import Data.JSString (pack)
|
import Data.JSString (JSString, pack)
|
||||||
import qualified Network.Client as Client
|
import qualified Network.Client as Client
|
||||||
import Network.Http (HttpResult (..))
|
import Network.Http (HttpResult (..))
|
||||||
import Control.Concurrent.MVar (tryTakeMVar, takeMVar, putMVar, swapMVar)
|
import Control.Concurrent.MVar (tryTakeMVar, takeMVar, putMVar, swapMVar)
|
||||||
|
|
||||||
|
import Common.Network.CatalogPostType (CatalogPost)
|
||||||
import Common.Component.Search.SearchTypes
|
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 :: Interface a -> Action -> Model -> Effect a Model
|
||||||
update iface (SearchChange q) model = model { searchTerm = q } <# do
|
update iface (SearchChange q) model = model { searchTerm = q } <# do
|
||||||
consoleLog $ "SearchChange " <> q
|
consoleLog $ "SearchChange " <> q
|
||||||
|
|
|
@ -34,6 +34,10 @@ import Network.SiteType (Site)
|
||||||
import qualified Common.FrontEnd.Action as A
|
import qualified Common.FrontEnd.Action as A
|
||||||
import Common.Network.ClientTypes
|
import Common.Network.ClientTypes
|
||||||
|
|
||||||
|
data Interface a b = Interface
|
||||||
|
{ passAction :: Action b -> a
|
||||||
|
, returnResult :: Http.HttpResult b -> a
|
||||||
|
}
|
||||||
|
|
||||||
update
|
update
|
||||||
:: Interface a b
|
:: Interface a b
|
||||||
|
|
Loading…
Reference in New Issue