Skip to content
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

Render objects by calling .toString() on them #105

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

joshski
Copy link
Member

@joshski joshski commented Jul 10, 2018

I would like to pass objects into hyperdom.html() and have hyperdom call .toString() on those objects.

Hyperdom calls JSON.stringify() when it doesn't know what else to do with an object. This might be reasonable behaviour for primitive objects, so this change preserves that behaviour, but calls .toString() on user-defined types that implement .toString()

@joshski joshski requested a review from refractalize July 10, 2018 08:43
@refractalize refractalize force-pushed the render-objects-by-calling-tostring branch from 3e169fc to b59f938 Compare July 10, 2018 10:36
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

Successfully merging this pull request may close these issues.

2 participants