Skip to content

Convert Node<Msg> to String #414

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
nlinker opened this issue Apr 8, 2020 · 3 comments
Closed

Convert Node<Msg> to String #414

nlinker opened this issue Apr 8, 2020 · 3 comments

Comments

@nlinker
Copy link

nlinker commented Apr 8, 2020

Hello!

Let me ask a question on the API. I have a trouble with the debugging and testing code.
One of the problem is that what the appropriate method to convert some Node (or vector of Node-s) to nicely indented String, e.g.

let node: Node<Msg> = div![
        class![ "my-class-1", "my-class-2" ],
        button![ev(Ev::Click, |_| Msg::Decrement), "-"],
        div![model.to_string()],
        button![ev(Ev::Click, |_| Msg::Increment), "+"],
    ];
println!("{}", node._???_());

What do I here to print <div class="my-class-1 my-class-2">...</div>?

Thanks.

@nlinker nlinker changed the title Convert Node<Msg> to String Convert Node<Msg> to String Apr 8, 2020
@MartinKavik
Copy link
Member

MartinKavik commented Apr 8, 2020

I'm afraid that implementation of Node -> String "freezed" - #294.
And it's not top priority for me now, so no ETA unfortunately.

@MartinKavik
Copy link
Member

MartinKavik commented Apr 8, 2020

So we use log!(node) (it's basically println!("{:#?}", node) + console.log).

@nlinker
Copy link
Author

nlinker commented Apr 8, 2020

I see, thanks for the answer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants