Comments (7)
Usable<T>
could be a good proposal, too.
from fusion.
Verbose isnt always bad thing.
In this case its clear as day what CanBeState means, while something like Dynamic doesn't get across immediately
CanBeState isnt even that long
from fusion.
Verbose isnt always bad thing.
In this case its clear as day what CanBeState means, while something like Dynamic doesn't get across immediately
CanBeState isnt even that long
This is the single most used type definition across all Fusion code bases I've ever worked with, and likely it's going to increase over time, so every little bit counts here. I've found this type name clutters up a lot of property list definitions especially, so I'm interested in optimising that use case.
from fusion.
Perhaps a name like MayChange<T>
helps retain some of the original clarity while still moving away from assuming knowledge of state objects.
from fusion.
After some further discussion in the community Discord channel, we considered a few more names:
Describes<T>
Contains<T>
Becomes<T>
Into<T>
UsedAs<T>
As<T>
StateOf<T>
StateOr<T>
Or<T>
Maybe<T>
- a bunch of other rejected ideas
After much discussion we settled on a few strong ideas:
StateOr<T>
- essentially a more conciseCanBeState<T>
, but still leans heavily on state terminology which goes against the goal of pushing state objects further into implementation detail territoryDescribes<T>
- conveys a lot of meaning, but can be a little bit clunky in large code blocksBecomes<T>
- same issue as aboveContains<T>
- strongly leading name; seems to suggest the existence of a structureUsedAs<T>
- very concise and nicely encapsulates the way people think about this type (don't care what it is, only what comes out ofuse()
), but would be nicer to consolidate down to one succinct wordAs<T>
- almost as strong as above, avoids its main issue but loses out a bit on clarity - is is clear that new users know what it means?
Right now, myself and the people who I talked to agree that As<T>
seems to have the strongest combination of traits, but I think it is still good to collect further thoughts on this.
from fusion.
The symmetry of type Use = <T>(UsedAs<T>) -> T
is quite nice.
from fusion.
After talking with some more groups, common opinion seems to be that the clarity of UsedAs<T>
outweighs the conciseness of As<T>
, so (at least for the time being) I think that it would be the option that achieves most of the goals set out above while retaining enough clarity to be understood by a wide audience.
from fusion.
Related Issues (20)
- Fusion.Children should parent things in batching order HOT 7
- Allow T everywhere we publicly accept StateObject<T> HOT 1
- Dissolve state objects that don't deal with state HOT 4
- Dealing with re-entrant updates HOT 2
- Introduce a more efficient connector between state and data model properties
- Heuristic memoisation for state objects HOT 1
- Add debugging protocol for non-invasive inspection
- Change design of Observer to allow pooling listeners HOT 1
- Reuse scopes from primitive computed objects HOT 3
- Test what an ideal scope pool size is HOT 1
- Integrate under-documented APIs into tutorials
- Explore safer interpretations of `deriveScope` HOT 1
- Spring setters don't work immediately after construction
- Memoise special key generation functions
- Poor typechecking for use functions with UsedAs<T>
- Derive scopes with additional methods HOT 2
- Standard set of reactive graph shapes for testing HOT 1
- Write tutorial for `Safe` expressions
- Broken default props link (still uses .lua)
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 fusion.