| (ns slagyr.async) | |
| (den foo [] | |
| (js/setTimeout | |
| (fn [] (throw (js/Error. "foo"))) | |
| 100)) | |
| (try | |
| (foo) | |
| (catch js/Object e |
Note: if you want to skip history behind this, and just looking for final result see: rx-react-container
When I just started using RxJS with React, I was subscribing to observables in componentDidMount and disposing subscriptions at componentWillUnmount.
But, soon I realised that it is not fun to do all that subscriptions(that are just updating property in component state) manually, and written mixin for this...
Later I have rewritten it as "high order component" and added possibility to pass also obsarvers that will receive events from component.
Hi Nicholas,
I saw you tweet about JSX yesterday. It seemed like the discussion devolved pretty quickly but I wanted to share our experience over the last year. I understand your concerns. I've made similar remarks about JSX. When we started using it Planning Center, I led the charge to write React without it. I don't imagine I'd have much to say that you haven't considered but, if it's helpful, here's a pattern that changed my opinion:
The idea that "React is the V in MVC" is disingenuous. It's a good pitch but, for many of us, it feels like in invitation to repeat our history of coupled views. In practice, React is the V and the C. Dan Abramov describes the division as Smart and Dumb Components. At our office, we call them stateless and container components (view-controllers if we're Flux). The idea is pretty simple: components can't
| module.exports = function(duration) { | |
| return function(){ | |
| return new Promise(function(resolve, reject){ | |
| setTimeout(function(){ | |
| resolve(); | |
| }, duration) | |
| }); | |
| }; | |
| }; |
| module Cli where | |
| port output : String | |
| port output = | |
| "Sub-orbital table 8-bit realism boat soul-delay face forwards industrial | |
| grade drone. Cartel towards footage tube assault table woman stimulate bridge | |
| claymore mine semiotics human. Post-construct j-pop military-grade stimulate | |
| narrative realism. Shoes convenience store sunglasses realism numinous tanto | |
| long-chain hydrocarbons. Franchise tower render-farm girl wonton soup sprawl | |
| fetishism Kowloon advert semiotics shoes dolphin drugs otaku marketing. |
| export class EnumSymbol { | |
| sym = Symbol.for(name); | |
| value: number; | |
| description: string; | |
| constructor(name: string, {value, description}) { | |
| if(!Object.is(value, undefined)) this.value = value; | |
| if(description) this.description = description; |
Inspired by dannyfritz/commit-message-emoji
See also gitmoji.
| Commit type | Emoji |
|---|---|
| Initial commit | 🎉 :tada: |
| Version tag | 🔖 :bookmark: |
| New feature | ✨ :sparkles: |
| Bugfix | 🐛 :bug: |
Should be work with 0.18
Destructuring(or pattern matching) is a way used to extract data from a data structure(tuple, list, record) that mirros the construction. Compare to other languages, Elm support much less destructuring but let's see what it got !
myTuple = ("A", "B", "C")
myNestedTuple = ("A", "B", "C", ("X", "Y", "Z"))| # fix owner of files and folders recursively | |
| sudo chown -vR $(whoami) /usr/local /opt/homebrew-cask /Library/Caches/Homebrew | |
| # fix read/write permission of files and folders recursively | |
| chmod -vR ug+rw /usr/local /opt/homebrew-cask /Library/Caches/Homebrew | |
| # fix execute permission of folders recursively | |
| find /usr/local /opt/homebrew-cask /Library/Caches/Homebrew -type d -exec chmod -v ug+x {} + |