Skip to content

Instantly share code, notes, and snippets.

export const stateTracking = atomFamily<string[], JourneyType>({
key: 'state-product-tracking',
default: [],
});
import { SerializableParam } from 'recoil';
export interface IRecoilId
extends Readonly<Record<string, SerializableParam>> {
id: string;
journey: JourneyType;
}
export enum JourneyType {
order = 'order',
review = 'review',
}
import { atomFamily } from ‘recoil’;
import { IRecoilId } from ‘../../interfaces’;
export const stateProductId = atomFamily<string, IRecoilId>({
key: 'state-product-id',
default: '',
});
@bnayae
bnayae / Cypher Builder Simple Statement.md
Last active February 2, 2020 13:44
Cypher Builder: Simple Statement

Option 1

.Pattern<Foo, Bar>((n , r) => n("n", "label", exclude: f => f.Name)) - r["r","type", convention: x => x != nameof(Bar.Date)] > n("n1")
.Pattern<Foo, Bar>((n , r) => n("n", "label", f => f.Name, f => f.Date)) - r["r","type", nameof(Foo.Date), nameof(Foo.Id)] > n("n1")

Option 2

.Pattern<Foo, Bar>((n , r) => n(n1 => n1.label, exclude: f => f.Name)) - r[r1 => r1.type, convention: x => x != nameof(Bar.Date)] > n("n1")
private static async Task Exec()
{
try
{
await Task.Delay(1);
await A();
}
catch (Exception ex)
{
Trace.WriteLine(ex.Format());
private static async Task Exec()
{
try
{
await Task.Delay(1);
await A();
}
catch (Exception ex)
{
Trace.WriteLine(ex);
public static IObservable<TSource> Filter<TSource>(
this IObservable<TSource> source,
Func<TSource, bool> predicate)
{
return source.Where<TSource>(predicate);
}
using System.Reactive.Observable.Aliases;
// filter will invoke where
Observable.Range(0, 10).Filter(i => i % 2 == 0);
Observable.Range(0, 10).Where(i => i % 2 == 0);
// map will invoke select
Observable.Range(0, 10).Map(i => $"- {i} -");
Observable.Range(0, 10).Select(i => $"- {i} -");
Task<IAsyncDisposable> SubscribeAsync(IAsyncObserver<T> observer);
public interface IAsyncObserver<in T>
{
Task OnNextAsync(T value);
Task OnErrorAsync(Exception error);
Task OnCompletedAsync();
}