Questions tagged [purescript-pux]

Questions about the use of the Pux package in PureScript

Pux is a PureScript interface to React, similar to the Elm app architecture. It is a simple pattern for modular, nested components that are easy to test, refactor, and debug - making it simple and straightforward to build complex web applications.

12 questions
4
votes
1 answer

Error could not match type

I have a type: newtype User = User { id :: String , email :: String , last_update :: String } and a function: import Pux.DOM.HTML (HTML) import Pux.DOM.HTML.Attributes (key) import Text.Smolder.HTML as H import Text.Smolder.HTML.Attributes…
Tom Macdonald
  • 6,433
  • 7
  • 39
  • 59
3
votes
1 answer

How to generate Pux actions from a foreign module?

I'm trying to write an application using purescript-pux and CodeMirror, a static code editor. CodeMirror makes an editor from a text-area, but the events are handled differently, therefore I cannot use the onChange function from Pux.Html.Events. To…
Nick Tchayka
  • 563
  • 3
  • 14
2
votes
2 answers

How do you set the document title using Purescript?

After searching for some time I found in Pursuit the module DOM.HTML.History which has the data type DocumentTitle. This type could probably be used together with the function replaceState :: ∀ e. Foreign -> DocumentTitle -> URL -> History -> Eff…
kazuoua
  • 313
  • 4
  • 9
1
vote
0 answers

How to use purescript-css to set CSS margin property to auto?

I am converting a CSS file to purescript-css and in the CSS file there is the line margin:auto . I have looked at the margin function in the CSS.Geometry module of the purescript-css library and I cannot see how to use it to set the margin property…
user1023733
  • 805
  • 5
  • 14
1
vote
0 answers

Generate events from react components within Pux

I'm trying to integrate a react component (https://github.com/moroshko/react-autosuggest) within a Pux application, but failing to see how to raise events to be handled by the Pux event loop. react-autosuggest takes an explicit onChange callback…
Impredicative
  • 5,039
  • 1
  • 17
  • 43
1
vote
0 answers

Purescript-Pux: How to add a react component as property to another react component (Material-UI)

Some libraries like material-ui require to add components as properties to another react component. JSX Example (See live/complete): render() { const actions = [
shybyte
  • 11
  • 2
1
vote
2 answers

Integrating React components with Pux - where does require() come from?

The Pux documentation tells me to use require() in the browser. Where does that function come from and how do I use it? Background: I'm trying to integrate the Quill editor with my web application that uses purescript-pux. Following the Pux…
StantonT
  • 15
  • 4
0
votes
1 answer

Error: Target container is not a DOM element (when running Purescript Pux Program)

I've compiled this program with Purescript 0.12.5 but when I look at the index.html in Firefox 67.0.2 I get the following error in the web console: Error: Target container is not a DOM element. app.js:5160:15 Here is the index.html file:
user1023733
  • 805
  • 5
  • 14
0
votes
0 answers

Illegal Character Escape in Text.Smolder.Renderer.String.purs

In an attempt to compile my program, I received the following error regarding the file String.purs from the Text.Smolder.Renderer module: Error found: at bower_components\purescript-smolder\src\Text\Smolder\Renderer\String.purs:76: 56 - 76:57 (line…
user1023733
  • 805
  • 5
  • 14
0
votes
1 answer

How to implement a path with more than one subdomain using Pux.Router?

I'm using Pux.Router and can't get a path such as auth/facebook to work. auth works and facebook works but not together. For example FacebookAuth <$> (lit "facebook" *> param "access_token") <*> (param "expires_in") <* end works but not FacebookAuth…
torchhound
  • 510
  • 6
  • 15
0
votes
1 answer

How to handle effects with Pux?

I'm just a beginner to the whole world of Purescript and Pux, so I'm a little confused as to where we handle effects. Currently I'm modelling the effects in my type: type State = { countries ∷ Maybe (Eff (random :: RANDOM) Countries) } And then…
Wildhoney
  • 4,969
  • 33
  • 38
-1
votes
1 answer

Syntactical issue between order of two functions

Is there any order to be maintained while placing functions one another? I just tried the code on the online compiler provided by purescript.org itself "http://try.purescript.org" module Main where import Prelude import Data.List import Data.Array…