question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Rename `send` to `action` in docs & examples?

See original GitHub issue

Saw a lot of work is going on with v4. Very cool!

Just a thought here – actions are mentioned a lot as a concept throughout the documentation, but don’t exist as a word anywhere in the examples. What if we renamed send to action, since that’s what it’s doing? e.g.

const mainView = (state, prev, action) => html`
  <main>
    <h1>Title: ${state.title}</h1>
    <input
      type="text"
      oninput=${(e) => action('update', e.target.value)}>
  </main>
`

This might help clarify concepts and bring the ideas from the unidirectional architecture chart into the code – making it easier for beginners to understand and pick up. Since send is always referenced as a parameter it would not change the API at all, just the examples, and I think it would solidify the relationship between concepts and code considerably with one small tweak.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:9 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
yoshuawuytscommented, Oct 9, 2016

@timwis that would break the unidirectional model, and would require the extra done() callback in the views. I think creating a clear boundry between views and logic so far has paid off, I’d be cautious to mess with that

1reaction
Ryuno-Kicommented, Oct 16, 2016

In this case maybe updating the docs with “An action can trigger either an effect or a reducer.”?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Edit documents with a screen reader - Google Docs Editors Help
Take quick actions by searching the menus · Press Alt + / (Windows, Chrome OS) or Option + / (Mac). · Type a...
Read more >
Copy, rename, and move objects | Cloud Storage
Navigate to the object, which may be located in a folder. Click the more actions menu ( ) associated with the object. Click...
Read more >
Method: resources.features.rename | Admin console
Parameters. customer. string. The unique ID for the customer's Google Workspace account. As an account administrator, you can also use the my_customer alias ......
Read more >
Using Rename action for file
Use the Rename action to rename a file. This action enables you to rename a file based on its size and the date...
Read more >
Move/Rename file actions - Dropbox - Workato Docs
This action allows you to move or rename the existing files in your Dropbox instance. To rename a file/folder, change the file/folder name...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found