GithubHelp home page GithubHelp logo

Tutorial/Guide about reflex HOT 5 OPEN

djleonskennedy avatar djleonskennedy commented on May 27, 2024
Tutorial/Guide

from reflex.

Comments (5)

Gozala avatar Gozala commented on May 27, 2024 1

@djleonskennedy There is semi-finished guide here
https://gozala.gitbooks.io/reflex/content/

from reflex.

Gozala avatar Gozala commented on May 27, 2024

Current implementation is based on Elm 0.16, in 0.17 they introduced breaking API changes and new concepts like subscriptions plan was to update this library to match new API and also update guide accordingly, unfortunately I have not got around to wrapping that work up.

Than being said linked guide matches API of the library in it's current state.

from reflex.

sp4ghet avatar sp4ghet commented on May 27, 2024

Where is a good place to report issues/problems when reading the docs?

I found that the reflex-virtual-dom-driver/examples/counter is different from the docs and that the sample in the docs uses the address/send API differently than the examples. The one from the examples works for me, whereas the one from the Docs(Introduction) does not in my environment:

"reflex": "^0.4.1",
"reflex-virtual-dom-driver": "^0.2.5"

Docs(Introduction):

export const view =
  (model:Model, send:Address<Command>):DOM =>
  html.section({ className: "counter" }, [
    html.button({
      onClick: event => send({ type: "Decrement" })
    }, ["-"]),
    html.output({
        className: "value"
    }, [`${model.value}`]),
    html.button({
        onClick: event => send({ type: "Increment" })
    }, ["+"])
  ])

Docs(Basics):

export const view = (model:Model, address:Address<Message>):DOM =>
  html.section({
    className: "counter"
  }, [
    html.button({
      onClick: forward(address, createIncrement)
    }, ["-"]),
    html.output({ 
      className: "value"
    }, [`${model.value}`]),
    html.button({
      onClick: forward(address, createDecrement)
    }, ["+"])
  ])

Example:

export const view =
  ( model/*:Model*/
  , address/*:Address<Action>*/
  )/*:DOM*/ =>
  html.span
  ( { key: "counter"
    }
  , [ html.button
      ( { key: "decrement"
        , onClick: forward(address, Decrement)
        }
      , ["-"]
      )
    , html.span
      ( { key: "value"
        , style: counterStyle.value
        }
      , [ `${model.value}` ]
      )
    , html.button
      ( { key: "increment"
        , onClick: forward(address, Increment)
        }
      , ["+"]
      )
    ]
  )

from reflex.

Gozala avatar Gozala commented on May 27, 2024

Where is a good place to report issues/problems when reading the docs?

@spaghet feel free to open issues in this repo.

I found that the reflex-virtual-dom-driver/examples/counter is different from the docs and that the sample in the docs uses the address/send API differently than the examples. The one from the examples works for me, whereas the one from the Docs(Introduction) does not in my environment:

Can you elaborate (in the separate issue) what do you mean by does not work ? Are the exceptions thrown ? Is something else gets rendered ?

from reflex.

sp4ghet avatar sp4ghet commented on May 27, 2024

Cool, thanks!
It's been a bit since I went over this so I will get back to you.

from reflex.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.