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
alert('Custom experience.'); |
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
query { | |
user(id: 2) { | |
id | |
login | |
roles { # also fetch roles | |
id # .. and their id | |
name # .. and their name | |
} | |
} | |
} |
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
import React, { Component } from 'react'; | |
export interface HeaderProps { | |
searchBoxProps: SearchBoxProps; | |
} | |
export class Header extends Component<HeaderProps> { | |
render() { | |
return ( | |
<div> |
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
import { flow, types } from 'mobx-state-tree'; | |
export const TagsStoreModel = types | |
.model('TagsStore', { | |
results: types.array(types.string), | |
isLoading: types.boolean, | |
query: types.string, | |
}) | |
.actions((self) => ({ | |
loadTags: flow(function * (query: string) { |
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
import { observable, action, extendObservable } from 'mobx'; | |
export class TagsStore { | |
private static defaultState: any = { | |
query: '', | |
isLoading: false, | |
results: [], | |
}; | |
@observable public results: string[]; |
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
import { Action } from 'redux'; | |
export enum TagActions { | |
Search = 'TAGS_SEARCH', | |
SearchUpdate = 'TAGS_SEARCH_UPDATE', | |
SearchError = 'TAGS_SEARCH_ERROR', | |
} | |
export interface TagsSearchAction extends Action { | |
type: TagActions.Search; |
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
interface HeaderProps { | |
searchBoxProps: SearchBoxProps; | |
} | |
class Header extends Component<HeaderProps> { | |
render() { | |
return ( | |
<div> | |
<SearchBox {...this.props.searchBoxProps} /> | |
</div> |
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
var toDoListApp = angular.module('ToDoListApp', []); | |
toDoListApp.controller('ToDoListController', function ($scope) { | |
/* Model */ | |
$scope.items = [ | |
{desc: 'Go shopping', done: false}, | |
{desc: 'Clean my room', done: true}, | |
{desc: 'Sleep', done: false} |
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
using System; | |
using System.Collections.Generic; | |
namespace Codenough.Demos.MapReduce | |
{ | |
public static class ListQuery | |
{ | |
public delegate bool Comparator<TSource>(TSource current, TSource target); | |
public delegate TAccumulate Aggregator<TSource, TAccumulate>(TSource current, TAccumulate value); |
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
using System; | |
namespace Codenough.Samples | |
{ | |
public class DeferredStream<TValue> : IStream<TValue> | |
{ | |
private readonly TValue head; | |
private readonly Func<IStream<TValue>> tail; | |
public DeferredStream(TValue head, Func<IStream<TValue>> tail) |