-
-
Notifications
You must be signed in to change notification settings - Fork 143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Confused about state keyword #59
Comments
Yeah, so this is something I have struggled with:
so this was the syntax I came up with. I agree that the colon I'm open to suggestions on how to make this more clear. |
I'm a total n00b on this framework, I'm trying to learn what's going on by studying the test cases. So my advice is offered only with extreme caution and should be taken the same way. First, I'm confused by basic declarations, Why is it I think of I'm sorry, I cannot come up with a small fix, I want to change everything! Being an old C programmer, I'd propose to use the leading keyword style everywhere.
The name of a record would become a declaration keyword too:
and then both properties and internal state would be:
As another way of digging in, I've started fixing typos and grammar in the guide and will be pushing those in a bit. Should I push them from my own repo or may I create a branch in your existing repo? |
Maybe use english like stores'
it seems like there's gonna be a lot of single-use records created for this, why not just create the record type?
I think I also imagine this scenario:
|
I quite like the |
After reading the comments there seems to be some confusion how Basically it works the same as in React:
The current I think what I learned here is:
I still don't know how to convey it in a nice and clean way. I like the |
As a newcomer, I'm looking for analogies and minimum number of concepts. I came in thinking of state as a kind of local-only property because that's the only example I see of a data item being declared and defaulted within in a component. Does the name of the variable have to be I do have a problem with This has got to be my last post on this thread till I gain more experience with Mint to support my blather. Thanks for your patience! |
@bobhy I might not be helping too much, but have you taken a look at React's State is a separate immutable object from your component and there are specifics as to how it will update. I do think it could be interesting to define properties on the state object with the state keyword working like a visibility keyword (public/private). But that will make it very hard to do e.g. |
After thinking about this for a while I've decided to make the The new version will look like this:
I've created a gist from the counter and drag example using this approach: https://gist.github.com/gdotdesign/fcbbc1877f92295b76ec5d9acb88e958 This means that:
I'll do the implementation and see how it works. I would appreciate any feedback on this, especially on the keyword: does |
I think this sounds like an awesome idea. More consistent and easier to use. It also makes sense for stores since you don't pass a property into a store in the same way you do with a component. So using state instead here seems great to me. |
I get the idea of having private state in the component, but the sample article confused me.
state
is a keyword, why does it need a:
in the example?private
?The text was updated successfully, but these errors were encountered: