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

Add create function prefix #29

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

profuel
Copy link

@profuel profuel commented Jan 19, 2021

We use this quite often, so I think it makes sense to include in the convention


```js
function createPage(pageName) {
return new Page(pageName)
Copy link

@silesky silesky Jan 25, 2021

Choose a reason for hiding this comment

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

Create makes sense.

However, the “new” keyword already implies “create”, making the example potentially confusing, since it’s adds no meaningful context and thus seems like an overly ‘contrived’ abstraction.

Would it make sense for this example to imitate delete (where it assumes a database model)?

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.

None yet

3 participants