Skip to content

Instantly share code, notes, and snippets.

View robwormald's full-sized avatar

Rob Wormald robwormald

View GitHub Profile
import * as ng from '@angular/platform'
function todoAppState(state = {todos: [1,2,3]}, action = {type:''}){
switch (action.type) {
case 'ADD_TODO':
return {
todos: state.todos.concat((action as any).payload),
...state
}
default:
'use strict';
/**
* @ngdoc module
* @name sails.io
* @file angular-sails-io.js
*
* @description
*
* This file allows you to send and receive socket.io messages to & from Sails
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
typeof define === 'function' && define.amd ? define(['exports'], factory) :
(factory((global.lit = {})));
}(this, (function (exports) { 'use strict';
/**
* @license
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
* This code may only be used under the BSD style license found at
interface Action {
type: string;
}
enum UserActions {
ADD_USER = 'ADD_USER',
DELETE_USER = 'DELETE_USER'
}
describe(‘My Effects’, () => {
let effects: MyEffects;
let actions: Observable<any>;
beforeEach(() => {
TestBed.configureTestingModule({
providers: [
MyEffects,
provideMockActions(() => actions),
// other providers
@NgModule({
imports: [
StoreModule.forRoot(appReducers),
EffectsModule.forRoot([SourceA, SourceB]),
RouterModule.forRoot([
{ path: ‘lazy’, loadModule: ‘./lazy.module#LazyModule’ }
])
]
})
export class AppModule { }
import {InjectionToken} from '@angular/core'
import {Http} from '@angular/http'
import {Observable} from 'rxjs/Rx'
//simple fn
export function AddDrama(value:string){
return `${value}!!!`
}
export const AddDramaProvider = {
//hacked up view engine parts
import {ComponentFactory, ComponentRef} from './core/linker/component_factory';
import {ErrorHandler} from './core/error_handler';
import {Injector} from './core/di/injector';
import {NgModuleRef} from './core/linker/ng_module_factory';
import {RendererFactory2} from './core/render/api';
import {Sanitizer} from './core/security';
import {initServicesIfNeeded} from './core/view/index';
import {SimpleRendererFactory} from './core/renderer';
import {NgModule, Component} from '@angular/core'
import {BrowserModule} from '@angular/platform-browser'
@Component({
selector: 'demo-app',
template: `
<h1>hello {{name}}</h1>
`
})
export class DemoApp {
{
"summaries": [
{
"symbol": {
"__symbol": 0,
"members": []
},
"metadata": {
"__symbolic": "class"
},