Skip to content

Instantly share code, notes, and snippets.

@taylorc
taylorc / post.actions.ts
Created May 9, 2018 03:20
post.actions.ts
export class FetchPosts {
static readonly type = '[Posts] Fetch Post';
}
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { Action, Selector, State, StateContext } from '@ngxs/store';
import { FetchPosts } from './post.actions';
export interface PostStateModel {
posts: Post[];
loading: boolean;
}
<div class="middleDiv">
<p>
<button (click)='addOneToCount()'>Increment</button>
<button (click)='subtractOneFromCount()'>Decrement</button>
</p>
<div class="slidingVertical">{{state.count}}</div>
</div>
import { ChangeDetectorRef, Component, OnDestroy, OnInit } from '@angular/core';
import { Select, Store } from '@ngxs/store';
import { Observable } from 'rxjs/Observable';
import { Subscription } from 'rxjs/Subscription';
import { DecrementCount, IncrementCount } from './home.actions';
import { HomeState, HomeStateModel } from './home.store';
// tslint:disable-next-line:import-blacklist
import { Action, State, StateContext } from '@ngxs/store';
import { DecrementCount, IncrementCount } from './home.actions';
//step 1
export interface HomeStateModel {
count: number;
}
//step 2
export class IncrementCount {
static readonly type = '[Home] Increment Count';
}
export class DecrementCount {
static readonly type = '[Home] Decrement Count';
}
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->
public static void CallWaiting(Action fn, int retryAttempts = 100, int threadSleepValue = 1000)
{
// We will try to call the function up to 100 times...
int j = 0;
for (int i = 0; i < retryAttempts; ++i)
{
j = i;
try
{
// We call the function passed in and return the result...
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">
<session-factory>
<property name="connection.provider">NHibernate.Connection.DriverConnectionProvider</property>
<property name="dialect">NHibernate.Dialect.MsSqlCeDialect</property>
<property name="connection.driver_class">NHibernate.Driver.SqlServerCeDriver</property>
<property name="connection.connection_string">Data Source=FirstSample.sdf</property>
</session-factory>
</hibernate-configuration>
<Target Name="MakeWebConfig">
<ItemGroup>
<Namespaces Include="Mynamespace">
<Prefix>x</Prefix>
<Uri>urn:nhibernate-configuration-2.2</Uri>
</Namespaces>
</ItemGroup>
<MSBuild.ExtensionPack.Xml.XmlFile
TaskAction="UpdateElement"
File="%(BuildArtifactsDirWebConfig.FullPath)"