introduce a `Point` model
See original GitHub issueDo you want to request a feature or report a bug?
Improvement.
What’s the current behavior?
Right now ranges have properties that represent their two points:
anchorKey
anchorOffset
focusKey
focusOffset
This is alright, but this idea of a “point” is only inferred. There are already places in the codebase that refer to “points” informally, like in the findPoint
utility. And we’ve thought about adding even more of them.
What’s the new behavior?
We’d introduce a new model called a Point
:
Point {
key
offset
}
And ranges would just have two points, range.anchor
and range.focus
.
This would standardize the data structure, making it easier to use in some cases since we can provide the utility functions on the Point
model directly, and make it more of a known entity for userland code to build with.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:4
- Comments:10 (10 by maintainers)
Top Results From Across the Web
Understanding Point Process Model — part 1
A hands-on introduction to point process models with R ... We can model the intensity of the inhomogenous point process as a function...
Read more >How to Introduce The Decision Model Successfully
All paths to organizational decision modeling encounter a common question: How do you introduce The Decision Model into an organization?
Read more >Introduction to models - University of Cape Town
Introduction to models. The major artifacts of software analysis and design are models, a model being a representation of one or more aspects...
Read more >Modelling & Simulation - Introduction - Tutorialspoint
Step 6 − Create a document of the model for future use, which includes objectives, assumptions, input variables and performance in detail. Step...
Read more >Introduction to Modeling
Roughly defined, mathematical modeling is the process of constructing math- ... The starting point is the bubble in the upper left-hand, real-world.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@ianstormtaylor I will use
anchorPoint
andfocusPoint
as the first step. If they are working, then I will try to rename them and moverange.focus
to value in the same PR.@zhujinxuan ah good point. I think I’d like to deprecate the
.focus()/.blur()
methods (onRange
, not onChange
) and rename them to something like.setIsFocused(boolean)
instead. Or even just remove them in favor of using.set('isFocused', true)
from Immutable.js honestly.(This follows with a separate idea I have that ranges themselves shouldn’t even be where the “focused” state lives, since they are lower level than that, but that’s a discussion for another time.)