Move back Interface definitions for Network.Client and Search components

- these were in the common submodule
This commit is contained in:
towards-a-new-leftypol 2024-03-05 20:36:21 -05:00
parent 059bc1b5d9
commit 4fd5702b27
3 changed files with 15 additions and 2 deletions

@ -1 +1 @@
Subproject commit d399e10ecb5342c405dbe23e570c7200ef951b9d
Subproject commit 2d5c169087d67f2444a5d231f44dcf90bae43054

View File

@ -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

View File

@ -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