Proposal for a lightning talk at the Reactive 2016.
Keep calm and like/retweet it on Twitter and star this Gist to vote on this talk.
I work at Grammarly. We like React and happily use it in our applications. However, sometimes something goes wrong and bugs creep into the code. Here comes testing. It helps make us confident about the quality of our code.
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
/* VT100 terminal reset (<ESC>c) */ | |
console.log('\033c'); | |
/* numbers comparations */ | |
> '2' == 2 | |
true | |
> '2' === 2 |
react + redux + RR
It uses https://gist.github.com/iNikNik/3c1b870f63dc0de67c38 for stores and actions.
1) create redux
const redux = createRedux(state);
2) get requireAccess func => bindCheckAuth to redux
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
/** | |
Returns a bounding rect for _el_ with absolute coordinates corrected for | |
scroll positions. | |
The native `getBoundingClientRect()` returns coordinates for an element's | |
visual position relative to the top left of the viewport, so if the element | |
is part of a scrollable region that has been scrolled, its coordinates will | |
be different than if the region hadn't been scrolled. | |
This method corrects for scroll offsets all the way up the node tree, so the |
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 admin = require('firebase-admin'); | |
admin.initializeApp({ | |
credential: admin.credential.cert('./movies-387bf-firebase-adminsdk-4hoi8-c52699119b.json'), | |
databaseURL: 'https://movies-387bf.firebaseio.com', | |
}); | |
// Get a database reference to our blog | |
const db = admin.database(); |
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
public class MyView extends SimpleViewManager<MapView> { | |
public static final String TAG = "MyView"; | |
@Override | |
public String getName() { | |
return TAG; | |
} | |
@Override | |
protected MapView createViewInstance(ThemedReactContext context) { |
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
/** | |
* Watcher leaks for jQuery | |
* RubaXa <trash@rubaxa.org> | |
* MIT Licensed. | |
* | |
* API: | |
* $.leaks.get(); | |
* $.leaks.watch(); | |
* $.leaks.unwatch(); | |
* $.leaks.remove(); |
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
window.addEventListener("orientationchange", function() { | |
alert(window.orientation); | |
//do whatever you want on orientation change here | |
}, false); |
NewerOlder