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

Rework default Server.fs - move to a module #465

Merged
merged 3 commits into from
Nov 22, 2021
Merged

Conversation

isaacabraham
Copy link
Member

Small reformatting but also move from a class to a module and let-bound functions.

| Ok () -> return todo
| Error e -> return failwith e
} }
{
Copy link
Member

Choose a reason for hiding this comment

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

is this fantomas formatting?

Copy link
Member Author

Choose a reason for hiding this comment

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

Probably not.

member __.GetTodos() = List.ofSeq todos

member __.AddTodo(todo: Todo) =
module Storage =
Copy link
Member

Choose a reason for hiding this comment

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

it looks more succinct and maybe even more idiomatic. I'm not convinced though - prefer to use explicit class/object notation when dealing with internal state. Probably a matter of preference though - curious what other think

Copy link
Member Author

Choose a reason for hiding this comment

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

@theimowski in absence of any feedback (happy for you to loop in some people explicitly) - I would suggest we go with this one and add a recipe for the class-based (with DI) approach.

@isaacabraham
Copy link
Member Author

@theimowski I'm going to merge this in on Monday unless there's any real objections.

@theimowski
Copy link
Member

theimowski commented Nov 13, 2021 via email

@isaacabraham isaacabraham merged commit 7fb5352 into master Nov 22, 2021
@isaacabraham isaacabraham deleted the module-server branch November 22, 2021 21:31
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