This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React, { useContext, useState } from 'react'; | |
| type GeneratedExampleContextValue = {}; | |
| type GeneratedExampleContextType = [ | |
| GeneratedExampleContextValue, | |
| React.Dispatch<React.SetStateAction<GeneratedExampleContextValue>> | |
| ]; | |
| const defaultProviderValue: GeneratedExampleContextValue = {}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const coffeeShoppe = {}; | |
| coffeeShoppe.coffee = 5.25; | |
| coffeeShoppe.latte = 4.25; | |
| coffeeShoppe.cheesecake = 4.00; | |
| /** | |
| * Get the price of the passed-in product name | |
| * @param {string} productName | |
| * @return {number|undefined} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const coffeeShoppe = {}; | |
| coffeeShoppe.coffee = 5.25; | |
| coffeeShoppe.latte = 4.25; | |
| coffeeShoppe.cheesecake = 4.00; | |
| /** | |
| * Get the price of the passed-in product name | |
| * @param {string} productName | |
| * @return {number|undefined} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var coffeeShoppe = {}; | |
| coffeeShoppe.coffee = 5.25; | |
| coffeeShoppe.latte = 4.25; | |
| coffeeShoppe.cheesecake = 4.00; | |
| /** | |
| * Get the price of the passed-in product name | |
| * @param {string} productName | |
| * @return {number|undefined} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var coffeeShoppe = {}; | |
| coffeeShoppe.coffee = 5.25; | |
| coffeeShoppe.latte = 4.25; | |
| coffeeShoppe.cheesecake = 4.00; | |
| coffeeShoppe.getProductPrice = function(productName){ | |
| return this[productName]; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var coffeeShoppe = {}; | |
| coffeeShoppe.coffee = 5.25; | |
| coffeeShoppe.latte = 4.25; | |
| coffeeShoppe.cheesecake = 4.00; | |
| coffeeShoppe.order = function(p) { | |
| let t = 0; | |
| const l = p.length; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @require 'sub-styles/vars' | |
| @require 'sub-styles/header' | |
| @require 'sub-styles/article' | |
| @require 'sub-styles/footer' | |
| //vs. | |
| @require 'sub-styles/vars' | |
| @require 'sub-styles/*' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var $element = $('#myThing'), | |
| elementPaddingLeft = $element.css('paddingLeft'), | |
| newValue = elementPaddingLeft + 20; | |
| $element.css('paddingLeft', newValue); | |
| // How about all at once? | |
| var $element = $('#myThing'); | |
| $element.css('paddingLeft', '+=20'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Where's that thing? | |
| this.$el.find('.thing'); | |
| // Ooh yes, that thing! | |
| this.$('.thing'); | |
| // Let's store this thing for easy use later! | |
| this.$thing = this.$('.thing'); |
NewerOlder