Module

Halogen.Component.Proxy

Package
purescript-halogen-proxy
Repository
slamdata/purescript-halogen-proxy

#ProxyComponent Source

type ProxyComponent f i o = Component HTML (ProxyQ f i o) i o

The type of a proxied component.

#ProxyQ Source

data ProxyQ f i o a

The query algebra for proxied components. The queryQ function is used to construct values of this type as the constructors are private.

#queryQ Source

queryQ :: forall o i f. f ~> (ProxyQ f i o)

Lifts a query into ProxyQ. Every query sent to a ProxyComponent will need to go through this function.

#proxy Source

proxy :: forall m o i f. Component HTML f i o m -> Component HTML (ProxyQ (Const Void) i o) i o m

Proxies a component, completely hiding the original query algebra.

#proxyQI Source

proxyQI :: forall m o i f. Component HTML f i o m -> Component HTML (ProxyQ f i o) i o m

Proxies a component, reusing the original query algebra as the proxied query algebra. Essentially creates a component that lifts f into ProxyQ.

#proxyQL Source

proxyQL :: forall m o i g f. Component HTML (Coproduct f g) i o m -> Component HTML (ProxyQ f i o) i o m

Proxies a component, hiding the left side of a coproduct query algebra but continuing to expose the right.

#proxyQR Source

proxyQR :: forall m o i g f. Component HTML (Coproduct f g) i o m -> Component HTML (ProxyQ g i o) i o m

Proxies a component, hiding the right side of a coproduct query algebra but continuing to expose the right.

#proxyTrans Source

proxyTrans :: forall m o i g f. (g ~> f) -> Component HTML f i o m -> Component HTML (ProxyQ g i o) i o m

Proxies a component with a custom query algebra transform.

#proxyEval Source

proxyEval :: forall m o i g f. (forall b a. (b -> a) -> g b -> ParentDSL i (ProxyQ g i o) f Unit o m a) -> Component HTML f i o m -> Component HTML (ProxyQ g i o) i o m

Proxies a component with a function that handles the running of interior queries.

It's unlikely this is useful for common use cases - it's used to implement the rest of the proxy* functions, but may also allow for some use cases that were not considered by the functions provided in this library.