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
| let i = 0; | |
| class UsesConditional extends React.Component { | |
| render() { | |
| i++; | |
| return ( | |
| <div> | |
| <Conditional if={i % 2}> | |
| <span>Show Me</span> | |
| </Conditional> |
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
| <div className="pricing" style={{ opacity: purchasing ? 0.25 : '' }}> | |
| <Conditional if={purchaseComplete}> | |
| <div className="purchase-complete"> | |
| <h2>Thanks!</h2> | |
| <p> | |
| Thank you for your purchase of {formatPrice(this.state.total)}. | |
| We’ll send you a receipt shortly. | |
| </p> | |
| <p> | |
| <button |
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 args from "assert-args"; | |
| // Annotate functions for argument warnings in non-production environments: | |
| @args({ bar: String, baz: Function }) | |
| function foo(bar, baz) { | |
| } | |
| foo(); | |
| // Argument Warning: expected bar to be String, found undefined | |
| // Argument Warning: expected baz to be Function, found 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 React = require('react'); | |
| const { Link } = require('react-router'); | |
| /** | |
| * class ListItemLink < Router.Link | |
| * | |
| * Extends <Link /> to move the active class name to a wrapping <li> | |
| */ | |
| export default class ListItemLink extends Link { | |
| /** |
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 foo = Symbol('foo'); | |
| class MyClass { | |
| constructor() { | |
| // Calling a private method!!! | |
| this[foo](); | |
| } | |
| [foo]() { | |
| alert('FOOOOOO!!!!!!'); |
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 foo = "foo", | |
| bar = "bar"; |
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
| # make node_modules/ | |
| node_modules/: package.json | |
| npm install |
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
| # Add a link to itself in its own node_modules directory: | |
| npm link && npm link app-name |
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
| <link rel="import" href="../google-map/google-map.html"> | |
| <polymer-element name="my-element"> | |
| <template> | |
| <style> | |
| :host { | |
| position: absolute; | |
| width: 100%; | |
| height: 100%; |
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
| [11:55:12] <@dandean> Found an incorrect variable declaration in that last PR. Caught it in canary! | |
| [11:55:15] <@oscar> mimi, its an experience | |
| [11:55:22] <@dandean> Fix is going to canary right now. | |
| [11:55:25] <tOm> WRITE A REGRESSION TEST | |
| [11:55:49] <@oscar> YEAH! If the tests didnt catch it, your tests gotta be better | |
| [11:56:35] <@dandean> you are correct sirs | |
| [11:56:53] <@oscar> tom and I are sitting our desks chanting "tests tests tests tests" | |
| [11:56:54] <@dandean> it's in a controller template helper – those can be a bit annoying to test. | |
| [11:57:01] <whilp> the noise is deafening | |
| [11:57:07] <whilp> all of alder is yelling "TESTS" |