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
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,18 @@ function composePageUrl(pageName, pageId) {

> See also [get](#get).

### `create`

Creates a new object.

```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)?

}
```

> See also [compose](#compose).

### `handle`

Handles an action. Often used when naming a callback method.
Expand Down