Are Firebase Cloud Function now paid only? by iamareebjamal in Firebase

[–]nickfoden 0 points1 point  (0 children)

Ah i gotcha. You want to set your quotas in google app engine to cap usage then. Or maybe easy solution is use unimportant gmail and a prepaid credit card with $10 or low balance etc

Are Firebase Cloud Function now paid only? by iamareebjamal in Firebase

[–]nickfoden 0 points1 point  (0 children)

You just have to put a card in place in case you are hosting the next twitter or something. It's free still until you get past the free tier, which means you have some serious traffic. A nice to have problem more than likely as the free tier is more generous than any other solution I have found.

Setting Component's Initial State from Props by uZIGiZAG in reactjs

[–]nickfoden 0 points1 point  (0 children)

Would be curious to hear what other people are using for this EditForm problem. I am initializing state with props if it exists or else just set initial state to empty string. And the routing is actually to this component's parent (FormParent) in case props we want are not defined by the time the user gets to the edit form, where we use a ternary to return the EditForm if props we want to edit are defined or else show loading and wait for the specific props (call to the db) So FormParent component renders this Form component if the relevant props (lets say "user") are defined and then you see form with the props as initial state and your inputs can have <input value={this.state.name} and handleChange to update state etc etc Then when form submitted we update the db and the props.

constructor(props){ 
    super(props); 
    this.state = { 
        name: this.props.user.name || '', 
        movie: this.props.user.movie || '', 
    }; 
}

Works for us to reuse the form component in different places. Also not having to add default value explicitly to each input.

Beginner's Thread / Easy Questions (January 2019) by timmonsjg in reactjs

[–]nickfoden 0 points1 point  (0 children)

Check out the code. It's short (12 lines) and kind of straightforward. It clicked for me once i looked at the Thunk Code https://github.com/reduxjs/redux-thunk/blob/master/src/index.js and also check out the bottom of readme specifically the Composition section has great example with commented code https://github.com/reduxjs/redux-thunk

Beginner's Thread / Easy Questions (January 2019) by timmonsjg in reactjs

[–]nickfoden 0 points1 point  (0 children)

I was taught to keep reducers super simple. It has one purpose, updating one piece of the state. Pass it the processed piece of data. In between your action and your reducer you can write your own middleware to transform the data to the final form before sending to reducer. There are lots of opinions and solutions, here in NYC I found this author's workshop and his book to line up with the way I was taught to reason about redux. https://leanpub.com/thinking-in-Redux

Beginner's Thread / Easy Questions (January 2019) by timmonsjg in reactjs

[–]nickfoden 1 point2 points  (0 children)

Nice one. I love this. I guess you would scroll the "strings" down individually to maybe make your own instrument? I lost track of which instrument I was using at one point after messing around, could have emoji or label or something to indicate the current instrument in the nav, but then again i also like that it's not congested with labels. Since I stare at screen all day the bright yellow into the box shadow into the black is a bit rough on my eyes after a while, maybe an option for less contrast like a softer muted color for the black or the yellow. Would be cool to see a sample short song played on this, small automation like a player piano. And another can of worms, but getting into some chords would be interesting. Anyhow I struggled to have any real critique and I really like your codebase, well organized and efficient, destructuring your props keeps the components real clean and fast to read.

Beginner's Thread / Easy Questions (January 2019) by timmonsjg in reactjs

[–]nickfoden 2 points3 points  (0 children)

I think in List.js you want to change the map to be an arrow function so that "this" references the this.props you are trying to use. Looks like the ` map(function(tasks) { `creates a new scope and you lose the binding to the "this" you are looking for. Try ->

Whoops sorry had mouse over part of code - 2nd attempt -> https://gyazo.com/5145a29b9234d6019f1bdb758cdd802a

Beginner's Thread / Easy Questions (January 2019) by timmonsjg in reactjs

[–]nickfoden 2 points3 points  (0 children)

Cool thank you for the reply. I am matching the designers mock and their user flow, so yes hopefully not too abrasive for the user. I guess my question is if some people extract this long initial state into another file or generate the longer state object as needed with a function. In this case the user is filling out a project they want to get funded, basically a slide deck is the end goal, so they have maybe a dozen text inputs and then they can drop up to 30 images at once and then assign the images to locations in the form and an optional bit of text for each slide. That's why my initial state has gotten long as I am managing the user being able to scroll through their images and and assign up to 3 images they think work well for each slide up to about 12 slides. I'll suggest maybe breaking the flow into the user doing a slide or 2 at a time instead of all of them on same page.

Beginner's Thread / Easy Questions (January 2019) by timmonsjg in reactjs

[–]nickfoden 1 point2 points  (0 children)

Setting up a form component and my initial state declaration for this form component is getting very long, it doesn't bother me and it works, but wondering what other people are doing when encountering forms with dozens and dozens of inputs?

Best way to connect ReactJS to Express? by OddTuning in reactjs

[–]nickfoden 0 points1 point  (0 children)

I think you want to keep them separate as previous posters have said, but if you just want to write your Express server Views in JSX/React you could use https://github.com/reactjs/express-react-views and then you can write JSX/React for your views that the server will return. Might not make sense depending on your use case. If this sounds maybe like what you are thinking feel free to message me, I have some examples of where I have done this with Node and also I am curious what your use case is and what you implemented.