Questions tagged [halogen]

Use for questions regarding purescript-halogen, a UI library for [purescript]

Halogen is a library and framework for user interaction and other aspects of web applications.

Resources

45 questions
8
votes
1 answer

PureScript Halogen and websockets

I'm trying to use purescript-halogen in combination with websockets, but after several attempts I'm unable to make them work together. I've seen this question on Thermite and websockets and Phil's answer regarding the Driver function. Halogen also…
user742071
5
votes
2 answers

Scroll action in PureScript Halogen

I'm using purescript-halogen, and I want to scroll to bottom of div when the child component's message were caught. However, it seems not present that scroll action control in Halogen. So, how can I Scroll to bottom of div? One solution I think is…
Neve
  • 53
  • 2
5
votes
2 answers

how to componentize purescript-halogen application

I would like to write specific components of my frontend using Purescript's Halogen. For example, I would like to create a registration form using Halogen. It would look something like below: module RegistrationForm where import Prelude ... -- |…
illabout
  • 3,517
  • 1
  • 18
  • 39
4
votes
1 answer

New Google sign-in button (GSI) doesn't render dynamically

I'm trying to integrate the new Google sign in button via HTML ( https://developers.google.com/identity/gsi/web/guides/display-button#button_rendering ) into an SPA. The
s with the app details and the one containing the button itself…
4
votes
1 answer

What's the best way to "destroy" a purescript-halogen component when you're done using it?

I'm using Halogen to control a menu system for my application, and I'm wondering how I can "destroy" a Halogen component. Right now, I have a function that creates a submenu component on a div with a particular ID. Throughout the lifecycle of the…
Albtzrly
  • 924
  • 1
  • 6
  • 15
4
votes
1 answer

How to render purescript-halogen components into the tag

How can I render a specific purescript-halogen component into the tag? The following example written for Halogen 1.0.0 renders the stylesheet and the paragraph into the HTML body: module Main where import Prelude import Control.Monad.Eff …
Siegfried Weber
  • 68
  • 1
  • 1
  • 7
3
votes
1 answer

Halogen keyboard-input example and unsubsribing to the events?

How to unsubscribe to keyboard events from other actions than HandleKey in the keyboard-input example? (The question is related to Halogen version 2.0.1 and purescript 0.11.4.) In the example the enter/return works. I have a group of elements that…
Gspia
  • 809
  • 6
  • 15
3
votes
1 answer

Do not run an halogen component when an html element is not present

I'm absolutely new to purescript and halogen. I'm trying to display an halogen component (myButton) when an html element exists, and do nothing otherwise. displayButton :: Eff (HA.HalogenEffects ()) Unit displayButton = HA.runHalogenAff do …
luis-fdz
  • 161
  • 1
  • 7
3
votes
1 answer

Send action from Eff in eval in Halogen?

I'm trying to throttle a search field in purescript-halogen. What I have so far: eval (Search search next) = do State st <- get -- clear last timeout liftEff' $ maybe (return unit) T.clearTimeout st.searchTimeout -- new timeout t <-…
Philip Kamenarsky
  • 2,757
  • 2
  • 24
  • 30
3
votes
1 answer

Automatically focus input element after creation in purescript-halogen

I'm using purescript-halogen to build a spreadsheet-like table (similar to Handsontable). If you double-click a cell, an html input element is rendered as a child of the respective table cell (and no such element is rendered for all the other…
dermoritz
  • 187
  • 8
3
votes
1 answer

How do I combine effectful event handlers and custom EventUpdates in purescript-halogen?

In my custom Halogen/Purescript project I follow the pattern from the AJAX Example where I split my actions up into pure Inputs and effectful Requests. I want to change my event handler to use the preventDefault behavior, but don't understand what…
passy
  • 7,170
  • 5
  • 36
  • 38
2
votes
0 answers

Integrating Halogen into Yesod build process

I would like to put together a webapp using Yesod for the back end and Halogen (PureScript) for the front end. Is there a best practice for having an integrated build process for the two? In particular is there a good way of having a single build…
John F. Miller
  • 26,961
  • 10
  • 71
  • 121
2
votes
1 answer

Can someone explain how the cofree comonad is "similar to" Halogen?

In the paper Declarative UIs are the future -- and the future is comonadic by Phil Friedman, he makes the claim, when introducing the cofree comonad that: ...this approach is reminiscent of the approach taken in the Halogen user interface…
Nathan BeDell
  • 2,263
  • 1
  • 14
  • 25
2
votes
1 answer

How to make focus components composable in Halogen

Playing with a simple demo app in Halogen with a dynamic list filled with values from an input field, I realized, that returning focus back to input after button click, is pretty hard. There is just 1 way: define FFI method which discovers element…
Daniil Iaitskov
  • 5,525
  • 8
  • 39
  • 49
2
votes
1 answer

How to implement something like an autoincrement counter in Purescript Halogen

Given a really simple increment component in something like React: class Increment extends React.Component { constructor(props){ super(props) this.state = { value: props.value } } componentDidMount() { setInterval(() =>…
danbroooks
  • 2,712
  • 5
  • 21
  • 43
1
2 3