| Instance | Branch |
|---|
| // from: https://dev.to/underdogio/adding-animations-to-your-react-app-with-react-transition-group | |
| import './styles.css' | |
| import React from 'react' | |
| import Transition from 'react-transition-group/Transition' | |
| import TransitionGroup from 'react-transition-group/TransitionGroup' | |
| import {render} from 'react-dom' | |
| function Card ({children, onRemove}) { | |
| return ( |
| // from: https://medium.jasonmdesign.com/display-medium-articles-on-your-site-d772b3b05779 | |
| // Resources: | |
| // https://codepen.io/loganpowell/pen/ppxYVz | |
| // https://help.medium.com/hc/en-us/articles/214874118-RSS-feeds | |
| $(function () { | |
| var $content = $('#jsonContent'); | |
| var data = { | |
| rss_url: 'https://medium.jasonmdesign.com/feed' | |
| }; |
| // === Arrays | |
| var [a, b] = [1, 2]; | |
| console.log(a, b); | |
| //=> 1 2 | |
| // Use from functions, only select from pattern | |
| var foo = () => [1, 2, 3]; |
// from: apollographql/apollo-link-state#10 (comment)
This puts my examples for a string and array variable to this much nicer code:
Initiate apollo in index.js:
import { ApolloClient } from 'apollo-client'
import { createHttpLink } from 'apollo-link-http'
import { InMemoryCache } from 'apollo-cache-inmemory'In this gist I would like to describe an idea for GraphQL subscriptions. It was inspired by conversations about subscriptions in the GraphQL slack channel and different GH issues, like #89 and #411.
At the moment GraphQL allows 2 types of queries:
querymutation
Reference implementation also adds the third type: subscription. It does not have any semantics yet, so here I would like to propose one possible semantics interpretation and the reasoning behind it.
A better async/reactive function design in JS (or any other languages) — the Universal Currying Callback (UCC) Design
For the principle "Don't call us, we'll call you", the modern function design uses callbacks, Promise, or monad/stream-based techniques (e.g. Rx) to let you subscribe the async results.
The following is a usual JS function implementation using the callback for async:
function register(username, password, email, callback) {
// processing async work| (ns sunil.curry) | |
| (defn partial+ | |
| "Takes a function f and fewer than the normal arguments to f, and | |
| returns a fn that takes a variable number of additional args. When | |
| called, the returned function calls f with args + additional args. | |
| differs from the core version in that it works on just one argument." | |
| {:added "1.0"} | |
| ([f] f) | |
| ([f arg1] |
