Skip to content
This repository was archived by the owner on Dec 19, 2023. It is now read-only.

Conversation

@kepta
Copy link
Contributor

@kepta kepta commented Jan 23, 2019

I noticed that there is no simple way to expose the normalised site base path to the html content of an Underreact project. This PR aims to fix that.

@davidtheclark for review, please.

@kepta kepta force-pushed the html-inject branch 2 times, most recently from 592beeb to b7c1949 Compare January 23, 2019 11:37
Copy link
Contributor

@davidtheclark davidtheclark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the user can create the HTML with a function, can we provide this information as an argument to the function? I would prefer that to an idiosyncratic templating system.

@kepta
Copy link
Contributor Author

kepta commented Jan 23, 2019

Since the user can create the HTML with a function, can we provide this information as an argument to the function? I would prefer that to an idiosyncratic templating system.

Good idea!

@kepta
Copy link
Contributor Author

kepta commented Jan 23, 2019

@davidtheclark updated the code to allow for passing a function to htmlSource.

Copy link
Contributor

@davidtheclark davidtheclark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me 👍

README.md Outdated
### htmlSource

Type: `string`\|`Promise<string>`. Default:[see the default HTML](https://github.com/mapbox/underreact/blob/next/lib/default-html.js).
Type: `string`\|`Promise<string>`\|`Function`. Default:[see the default HTML](https://github.com/mapbox/underreact/blob/next/lib/default-html.js).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could clarify this annotation as Function<string | Promise<string>>

@kepta kepta merged commit 43f7735 into master Jan 23, 2019
@kepta kepta deleted the html-inject branch January 23, 2019 19:11
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants