Comments (5)
In general, I think this ticket is aimed at code like this
const [variation_stone_transparency, _setVariationStoneTransparency] = usePreference(
"variation-stone-transparency",
);
function setVariationStoneTransparency(ev) {
const value = parseFloat(ev.target.value);
if (value >= 0.0 && value <= 1.0) {
_setVariationStoneTransparency(value);
}
}
... where the correct function to call to set the value is setVariationStoneTransparency
, then the underlying preference setter should be preceded by _
As Andy commented - "a common pattern in Prefs, but possibly elsewhere"
from online-go.com.
I think the gist of this ticket was "there's meaning behind the scheme, but it's inconsistently applied, so a first-time coder could get to know the code and make it applied consistently"
from online-go.com.
Well, what's here is the expectation that for a given state/preference xyz
there exists a corresponding function setXyz
that changes that value. In the case where we need some extra logic, we provide setXyz
as the function we use, but we have _setXyz
that that function calls after doing whatever special logic it needs. In this case, having the _setXyz
is "internal" in the sense that it is not meant to be directly called by ourselves, but it remains very clear that that is the actual setter, but that we should be using setXyz
.
from online-go.com.
Closing as "there's meaning behind the scheme and we like it as is" :)
from online-go.com.
In that case, open for business!
from online-go.com.
Related Issues (20)
- Broken github "fork me" image on about page
- Clarify cancellation message to avoid confusion for beginners
- `/me` endpoint returning invalid links with missing `/` HOT 1
- Newly created challenges via API automatically removed HOT 8
- Consolidate OGS API documentations into one, take the obsolete ones offline
- GoTV twitch chat cookies prompt HOT 6
- Stone removal matrix from the end of game is incorrectly used during analysis and score estimation of old moves HOT 4
- end game details are all broken HOT 7
- Live AI review for IRL relays HOT 2
- Ignoring a report causes incident report tracker count to include un-escalated reports
- Ignored reports are no longer ignored after reloading page
- Group incorrectly shown on group list HOT 2
- New X for captured stones - yuck! HOT 3
- Blocked users not blocked enough
- Incorrect rank determination in played matches.
- Title shows (0) moves made which isn't that helpful
- incorrectly displayed strength on the chart. Incorrectly classifies opponent in matches played Stronger/weaker opponents.
- Incorrect "You have won!" announcement for a tied game
- Keyboard shortcuts during AI review
- relocate global toggle for coordinatea
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 online-go.com.