##// END OF EJS Templates
added form/Form widget and form/_FormMixin, this is a rewritten version of the corresponding dojo classed....
added form/Form widget and form/_FormMixin, this is a rewritten version of the corresponding dojo classed. bind hooks are now specifing 'priority=false' parameter in setters. This will prevent excessive triggering of onChange events.

File last commit:

r133:a3fba6b6c42e default
r134:f139e2153e0d v1.9.0-rc1 default
Show More
subject-tests.ts
78 lines | 1.6 KiB | video/mp2t | TypeScriptLexer
/ djx / src / test / ts / subject-tests.ts
cin
added 'buffer' and 'subject' observable operators
r133 import { observe } from "./observable";
import { subject } from "./operators/subject";
cin
added observable subject producer
r125 import * as tap from "tap";
tap.test("Subject tests", t => {
let nextEvent: (value: string) => void = () => void (0);
cin
added 'buffer' and 'subject' observable operators
r133 const subj1 = observe<string>(({ next }) => {
cin
added observable subject producer
r125 t.comment("Start subject");
nextEvent = next;
return () => {
nextEvent = () => void (0);
t.comment("Stop subject");
};
cin
added 'buffer' and 'subject' observable operators
r133 }).pipe(subject);
cin
added observable subject producer
r125
const h1 = subj1.subscribe({
next: v => t.comment(`h1 next: ${v}`)
});
nextEvent("first");
const h2 = subj1.subscribe({
next: v => t.comment(`h2 next: ${v}`)
});
nextEvent("second");
h1.unsubscribe();
nextEvent("third");
h2.unsubscribe();
t.pass("Subject finished");
t.end();
}).catch(e => console.error(e));
tap.test("Subject tests #2", t => {
let nextEvent: (value: string) => void = () => void (0);
cin
added 'buffer' and 'subject' observable operators
r133 const subj1 = observe<string>(({ next, complete }) => {
cin
added observable subject producer
r125 t.comment("Start subject");
complete();
nextEvent = next;
return () => {
nextEvent = () => void (0);
t.comment("Stop subject");
};
cin
added 'buffer' and 'subject' observable operators
r133 }).pipe(subject);
cin
added observable subject producer
r125
const h1 = subj1.subscribe({
next: v => t.comment(`h1 next: ${v}`)
});
nextEvent("first");
const h2 = subj1.subscribe({
next: v => t.comment(`h2 next: ${v}`)
});
nextEvent("second");
h1.unsubscribe();
nextEvent("third");
h2.unsubscribe();
t.pass("Subject finished");
t.end();
}).catch(e => console.error(e));