https://linen.dev logo
Join Discord
Powered by
# react
  • g

    great-greece-86525

    07/07/2020, 8:22 AM
    Ah cool, that makes sense
  • u

    user

    07/07/2020, 8:23 AM
    e.g. I think there is a react c# somewhere in the ether. I'm not sure if it would give you any benefits to server side connection, I imagine it would be exactly the same.
  • c

    cool-psychiatrist-49311

    07/07/2020, 4:00 PM
    that basically boils down to a language comparison, ts/js vs haxe
  • c

    cool-psychiatrist-49311

    07/07/2020, 4:00 PM
    and my answer is: abstracts & macros
  • g

    great-greece-86525

    07/07/2020, 4:23 PM
    I haven't yet found a decent use case for abstracts apart from naming enums 🤷‍♂️
  • b

    brainy-machine-50829

    07/07/2020, 4:41 PM
    Main use for abstracts for me is being able to write safer and more descriptive code without sacrificing performance.
  • g

    great-greece-86525

    07/07/2020, 4:44 PM
    @User have you got an example/use case of how an abstract achieves this?
  • b

    brainy-machine-50829

    07/07/2020, 4:45 PM
    https://github.com/HaxeFoundation/haxe/blob/4.1.2/std/haxe/EnumFlags.hx
  • b

    brainy-machine-50829

    07/07/2020, 4:45 PM
    Various wrappers that limit/change the API.
  • b

    brainy-machine-50829

    07/07/2020, 4:46 PM
    Operator overloading (though that's not generally what abstract types are about – just happens to be the way to implement it in Haxe).
  • b

    bitter-family-72722

    07/07/2020, 4:58 PM
    @User https://haxe.org/blog/abstracting-primitives/
  • a

    ambitious-knife-25690

    07/10/2020, 1:18 PM
    @User For material-ui lib
    theme.spacing()
    is meant to have 4 parameters but your lib only has 1 is there a different API I should use to simulate the full effect?
  • u

    user

    07/10/2020, 1:22 PM
    Seems like an oversight, PRs welcome to support more arguments
  • a

    ambitious-knife-25690

    07/10/2020, 1:23 PM
    coolio!
  • a

    ambitious-knife-25690

    07/10/2020, 1:25 PM
    wait, how is a typedef a function call xD
  • a

    ambitious-knife-25690

    07/10/2020, 1:26 PM
    I was gonna do a
    @:overload
    but the function is defined as
    @:optional var spacing:Float->Float;
    in a typedef
  • a

    ambitious-knife-25690

    07/10/2020, 1:26 PM
    that's a neat trick?
  • a

    ambitious-knife-25690

    07/10/2020, 1:26 PM
    I guess, just change it to
    Float->Float->Float->Float->Float
    ?
  • a

    ambitious-knife-25690

    07/10/2020, 1:28 PM
    Nevermind, got a neater way to do it 👍
  • u

    user

    07/10/2020, 1:31 PM
    Yeah, the `Float`s (with
    ?
    !) could do
  • a

    ambitious-knife-25690

    07/10/2020, 1:33 PM
    Nah, even neater and no
    null
    :D
  • a

    ambitious-knife-25690

    07/10/2020, 1:34 PM
    Rest
  • u

    user

    07/10/2020, 1:35 PM
    Meh
  • u

    user

    07/10/2020, 1:36 PM
    Rest has no notion of "up to 4 float arguments"
  • a

    ambitious-knife-25690

    07/10/2020, 1:37 PM
    It doesn't, but it works appropriately
  • a

    ambitious-knife-25690

    07/10/2020, 1:37 PM
    I think it's the closest to the standard api
  • a

    ambitious-knife-25690

    07/10/2020, 1:38 PM
    and going passed the 4th parameter it just doesn't do anything
  • a

    ambitious-knife-25690

    07/10/2020, 1:38 PM
    I think most people get the css style api of the 4 params tho
  • u

    user

    07/10/2020, 1:38 PM
    Float->?Float->?Float->?Float->Float
    is the closest (the correct), not
    Rest<Float>
  • a

    ambitious-knife-25690

    07/10/2020, 1:41 PM
    rip, sent the pr x_x
1...484950...80Latest