-
Notifications
You must be signed in to change notification settings - Fork 2
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
Ospedale/hello world #1431
base: master
Are you sure you want to change the base?
Ospedale/hello world #1431
Conversation
{loading: Just _} -> Spinner.loadingSpinner | ||
{session: Nothing} -> loginComponent {setSession: setSession <<< Just} | ||
{session: Just s} -> renderSite (Just s.session) | ||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function is almost 100 lines. Would it make sense to factor it into smaller pieces?
] | ||
|
||
jsApp :: {} -> JSX | ||
jsApp = unsafePerformEffect app |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know about PureScript, but I think that unsafePerformIO
is generally regarded as an antipattern in Haskell.
let publishingTime :: Maybe LocalDateTime | ||
publishingTime = | ||
if not publish then Nothing | ||
else (_.publishingTime =<< inputArticle) <|> nowLocal |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could use guards instead of if
here.
where | ||
-- Assume only HTML elements | ||
buildBody (Html html) = html | ||
buildBody _ = "" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again, we have quite a lot of code. Personally, I'd prefer smaller pieces.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a rather large PR, but it might not make sense to try chopping it into smaller pieces. I find this code generally OK, though I didn't focus on details. Does Ospedale run with the usual yarn install
, yarn build
and yarn start
mantra? Maybe a README.md
containing installation instructions would be nice.
No description provided.