Comments (4)
Not a maintainer but I started doing :
src/constants/X/Y.json
Which might look like:
{
"FOO": "FOO@X/Y"
}
Sent from my iPhone
On Sep 18, 2014, at 2:53 PM, Tadeusz Wójcik [email protected] wrote:
I'd like to discuss best practices about naming actions. Currently I use actions named after what user has done, for example 'FILE_CLICKED', 'ZOOMED', 'VIEW_MODE_BUTTON_CLICKED' etc, is that good convention to name action like that? Only issue I see so far is that I have many *._CLICKED actions. Some people also tend to name actions more like commands, for example 'LOAD_DOCUMENT', 'CHANGE_VIEW_MODE' etc. I'd love your thoughts on that.
—
Reply to this email directly or view it on GitHub.
from flux.
I would try and not use the event trigger in an action name, for example 'CLICKED'. You could envision using the same code on a mobile app so it would in fact be triggered by a touch event and not a click.
Minor point though. I'd tend toward an imperative, command approach, i.e. PERFORM_THIS_ACTION and not include what triggered the action or how it should be done.
from flux.
I've grown to prefer the reverse syntax of NOUN_VERB
, like TODO_SELECT
. This way, in an alphabetized list, all my TODO
actions are together, and I generally want to sort on nouns, not verbs. But really this is just a personal preference, and any naming scheme you and your team have good reasons to adopt is perfectly appropriate.
from flux.
Great, thanks guys for the feedback! It's all what I wanted to know.
from flux.
Related Issues (20)
- Cannot dispatch in the middle of a dispatch. HOT 1
- New Flux store instance created upon second component referencing store HOT 7
- Flux Utils + Hooks HOT 6
- TypeError: Class constructor App cannot be invoked without 'new' HOT 1
- Using version of fbjs that depends on unsupported core-js module HOT 2
- Please update the following components: FluxContainer(containerClass) React 16.10.2 HOT 5
- how do we differ from Architecture and pattern? HOT 1
- Is this code a good way to update react component from dispatch in OOP class object? HOT 2
- Flux container breaks class methods defined with class properties syntax HOT 1
- Container create context issues after Babel 7.9.x update. HOT 5
- CVE-2020-15168 found in [email protected] HOT 13
- CVE-2020-7733 vulnerability by linking to an older fbjs version HOT 2
- Is fbemitter project discontinued? Is flux? HOT 1
- Add React 17 support
- NPM reports flux vulnerabilities HOT 3
- CVE-2021-27292: ua-parser-js needs to upgrade to 0.7.24 HOT 4
- mock flux store - react test HOT 2
- Will there be a Chinese version? HOT 1
- Video goes off screen and does not fit neatly HOT 1
- Add react-18 as peer dependency. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flux.