Inspired by dannyfritz/commit-message-emoji
See also gitmoji.
| Commit type | Emoji |
|---|---|
| Initial commit | 🎉 :tada: |
| Version tag | 🔖 :bookmark: |
| New feature | ✨ :sparkles: |
| Bugfix | 🐛 :bug: |
| import hoistStatics from 'hoist-non-react-statics'; | |
| import React from 'react'; | |
| /** | |
| * Allows two animation frames to complete to allow other components to update | |
| * and re-render before mounting and rendering an expensive `WrappedComponent`. | |
| */ | |
| export default function deferComponentRender(WrappedComponent) { | |
| class DeferredRenderWrapper extends React.Component { | |
| constructor(props, context) { |
| /** | |
| * Turns generators into async demons | |
| * | |
| * Within the generator function, any "yield" operator becomes enhanced with async powers | |
| * allowing them to yield promises. | |
| * | |
| * @example | |
| * spawn(function *() { | |
| * const data = yield fetch('/foo.json'); // will be resolved and assigned to "data" var | |
| * console.log(data); // write like its sync but its acually async ;) |
Inspired by dannyfritz/commit-message-emoji
See also gitmoji.
| Commit type | Emoji |
|---|---|
| Initial commit | 🎉 :tada: |
| Version tag | 🔖 :bookmark: |
| New feature | ✨ :sparkles: |
| Bugfix | 🐛 :bug: |
| let map = new Map(); | |
| map.set("a", 1); | |
| map.set("b", 2); | |
| map.set("c", 3); | |
| let obj = Array.from(map).reduce((obj, [key, value]) => ( | |
| Object.assign(obj, { [key]: value }) // Be careful! Maps can have non-String keys; object literals can't. | |
| ), {}); | |
| console.log(obj); // => { a: 1, b: 2, c: 3 } |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| #models.py | |
| class Task(models.Model): | |
| title = models.CharField(max_length=255) | |
| description = models.TextField() | |
| def __unicode__(self): | |
| return self.title |