This file contains 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 vehicles = [ | |
{ make: ‘Honda’, model: ‘CR-V’, type: ‘suv’, price: 24045 }, | |
{ make: ‘Honda’, model: ‘Accord’, type: ‘sedan’, price: 22455 }, | |
{ make: ‘Mazda’, model: ‘Mazda 6’, type: ‘sedan’, price: 24195 }, | |
{ make: ‘Mazda’, model: ‘CX-9’, type: ‘suv’, price: 31520 }, | |
{ make: ‘Toyota’, model: ‘4Runner’, type: ‘suv’, price: 34210 }, | |
{ make: ‘Toyota’, model: ‘Sequoia’, type: ‘suv’, price: 45560 }, | |
{ make: ‘Toyota’, model: ‘Tacoma’, type: ‘truck’, price: 24320 }, | |
{ make: ‘Ford’, model: ‘F-150’, type: ‘truck’, price: 27110 }, |
This file contains 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
/* in ES5 */ | |
//create Person | |
function Person () {} | |
// Person Inheritance a name through the prototype keyword | |
Person.prototype.name = “Garrett Mac”; | |
//Person is a constructor function because we will use new keyword to invoke it. |
Lifecycle (in order) | Triggered When | Use When |
---|---|---|
getDefaultProps | Triggered when | Useful when |
The result of getDefaultProps() will be cached and used to ensure that this.props.value will have a value if it was not specified by the parent component. | ||
componentWillMount() | Triggered before render(). | Useful when |
componentDidMount() | Triggered Called after render. Can access refs. The componentDidMount() method of child components is invoked before that of parent components. This is the place to call external libraries, use setTimeout, make ajax requests | Useful when |
shouldComponentUpdate(nextProps, nextState) | Triggered when updates | Useful when called when there are new props or state changes. return false to prevent a render. good for performance. |
componentWillReceiveProps(nextProps) | Triggered when view is updated | Useful when Called before render when props change. Access to old |
Bills and three types of resolutions.
Generally, bills are legislative proposals that, if enacted, carry the force of law, whereas resolutions do not. Though, this is not always true.
Bills, are legislative proposals that, if enacted, carry the force of law.
// RNSocialKitBridge.m
#import <React/RCTBridgeModule.h>
@interface RCT_EXTERN_MODULE(RNSocialKit, NSObject)
RCT_EXTERN_METHOD(addEvent:(NSString *)name location:(NSString *)location date:(nonnull NSNumber *)date)
@end
This file contains 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
page = Math.abs(parseInt(page) || 1) | |
console.log(" page: ",page); | |
//results to return | |
pageSize = parseInt(pageSize) || 10 | |
//cannot go above 50 | |
if(pageSize > maxsize)pageSize=maxsize | |
// limits payload size | |
let total= (µœ.data.length) |
This file contains 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
// Initialize Firebase | |
// TODO: Replace with your project's customized code snippet | |
var config = { | |
apiKey: "AIzaSyANxoHymSH5QMTrVXI0Njg-VBy4-oaoV1M", | |
authDomain: "newsoria-33414.firebaseapp.com", | |
databaseURL: "https://newsoria-33414.firebaseio.com" | |
}; | |
firebase.initializeApp(config); |
This file contains 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
@media screen, projection { | |
*, ::before, ::after { | |
box-sizing: inherit; | |
} | |
} | |
@media screen, projection { | |
ul:not(.browser-default) { | |
padding-left: 0px; | |
list-style-type: none; | |
} |