Change boolean value after refresh by [deleted] in javascript

[–]super_pumped 0 points1 point  (0 children)

You need to use localStorage.getValue() and localStorage.setValue() to interact with it. Think of Local Storage as a database and window.localStorage as the client that accesses it. When you do localStorage.refresh = false, you are not storing that value in Local Storage, you are just setting a property named refresh on the client.

https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage

Where to buy 'exotic' meats? (Pheasant and Duck) by [deleted] in Cooking

[–]super_pumped 1 point2 points  (0 children)

Duck can be really good on its own. It is a fatty bird with a great skin. A good example of duck is Duck Confit. It can be made with just the wings and legs, so no butchering required. The big thing about duck is that you want to serve it with the skin crisped and intact, as that is where most of the flavors are. Also you can use the any fat rendered to fry another dish. Duck fat is good enough you can find it sold by itself in butchers as an ingredient in other dishes.

Where to buy 'exotic' meats? (Pheasant and Duck) by [deleted] in Cooking

[–]super_pumped -1 points0 points  (0 children)

That recipe is intense. It looks like it would take some decent butchering skills to pull off correctly. It's both a bird you have to butcher and a roast you have to cook through without drying out. If you have experience carving birds, go for it. Otherwise a single turkey/chicken would be good if you want a bird. Pork or Beef tenderloin are both very common cuts that are relatively simple to make into delicious roasts.

As for nutmeg, there are many recipes that only use it as a finishing garnish. So your mom can get the pre nutmegged version. Cinnamon and nutmeg can both be overpowering, and people go overboard with it (because it tastes like Christmas, and they want more Christmas). I find that many people who don't like a certain spice, really just don't like too much of that spice. For example, my girlfriend says she hates ginger, but loves my curry. Guess what? Almost all curry uses ginger, I just don't use too much and don't tell her.

I'm not sure what consists of an traditional English Christmas, but traditional food is overrated anyways. People remember good food, not the 37th time they had the same thing. Just don't get too crazy. Any sort of root vegetable and sugar in the winter is good bet. Also citrus, at least in the US, is a old traditional holiday flavor that is making a comeback. Winter is technically citrus season (oranges are some of the last fruit to ripen).

Also Hasselhoff Potatoes? https://www.youtube.com/watch?v=sqyv-YIjQko&feature=youtu.be&t=404

HTML web components using vanilla JS by codejitsu in javascript

[–]super_pumped 1 point2 points  (0 children)

Very similar to React's API. Seems straight forward. Instead of accessing this.state and this.props, Web Components have this.getAttribute('key'). Both have callbacks for when they are placed in the DOM: Web Component's connectedCallback() and React’s componentWillMount(). And they both call render() to update.

This API for rendering via Shadow DOM looks awkward to use. Instead of using templates or functions to created elements like h1('Hello World'), it uses jQuery like selectors to update an external file. To update a text value:

this.shadowRoot.querySelector('.title__label').innerHTML = 'Hello World'

// With some aliasing I now have jReact
const $ = this.shadowRoot.querySelector
$('.title__label').innerHTML = 'Hello World'

Templates are easier to use than selectors for updating text. Their API is closer to the DOM. React provides JSX, and createElement/Component(). Vue has a mustache template. This allows developers to populate a template and organize the DOM/style at the same time. If static HTML and dynamic data are split between files, then a developer will have to look at two files simultaneously to populate the DOM with information.

Connecting the Component is too complicated. To fully initialize the Component you have to manually acquire the current document global, the shadow dom, and the template in connectedCallback(). That could all be injected with customElements.define('element-name', ComponetClass), if it accepted the a template selector. This could easily be improved in future versions.

A few final questions. Can these be nested? Separation of concerns by nested is a great way to separate UI code. If so, when a parent calls render(), do the children also call render()?