mirror of
https://github.com/Hopiu/postal.js.git
synced 2026-03-16 22:20:23 +00:00
Updated examples
This commit is contained in:
parent
ad61e30911
commit
c0b1d21a2b
2 changed files with 10 additions and 8 deletions
|
|
@ -71,9 +71,9 @@ define( ['postal', 'postaldiags'], function ( postal, diags ) {
|
|||
} ).withConstraint( function () {
|
||||
return drIsInTheTardis;
|
||||
} );
|
||||
channel.publish( "Tardis.Depart", { value : "Time for time travel....fantastic!" } );
|
||||
channel.publish( "Tardis.Depart", { value : "Time for time travel....fantastic!" } );
|
||||
drIsInTheTardis = true;
|
||||
channel.publish( "Tardis.Depart", { value : "Time for time travel....super!" } );
|
||||
channel.publish( "Tardis.Depart", { value : "Time for time travel....stellar!" } );
|
||||
drIsInTheTardis = true; // constraint will pass now
|
||||
channel.publish( "Tardis.Depart", { value : "Time for time travel....fantastic!" } );
|
||||
wcSubscription.unsubscribe();
|
||||
|
||||
|
|
@ -87,8 +87,9 @@ define( ['postal', 'postaldiags'], function ( postal, diags ) {
|
|||
|
||||
// Using withDelay() to delay the subscription evaluation
|
||||
var wdSubscription = channel.subscribe( "He.Will.Knock.Four.Times",function ( data ) {
|
||||
$( "<li>" + data.value + "</li>" ).appendTo( "#example8" );
|
||||
$( "<li>" + data.value + "(Received at: " + new Date() + ")</li>" ).appendTo( "#example8" );
|
||||
} ).withDelay( 5000 );
|
||||
$( "<li>Publishing Started at: " + new Date() + "</li>" ).appendTo( "#example8" );
|
||||
channel.publish( "He.Will.Knock.Four.Times", { value : "Knock!" } );
|
||||
channel.publish( "He.Will.Knock.Four.Times", { value : "Knock!" } );
|
||||
channel.publish( "He.Will.Knock.Four.Times", { value : "Knock!" } );
|
||||
|
|
|
|||
|
|
@ -70,9 +70,9 @@ $( function () {
|
|||
} ).withConstraint( function () {
|
||||
return drIsInTheTardis;
|
||||
} );
|
||||
channel.publish( "Tardis.Depart", { value : "Time for time travel....fantastic!" } );
|
||||
channel.publish( "Tardis.Depart", { value : "Time for time travel....fantastic!" } );
|
||||
drIsInTheTardis = true;
|
||||
channel.publish( "Tardis.Depart", { value : "Time for time travel....super!" } );
|
||||
channel.publish( "Tardis.Depart", { value : "Time for time travel....stellar!" } );
|
||||
drIsInTheTardis = true; // constraint will pass now
|
||||
channel.publish( "Tardis.Depart", { value : "Time for time travel....fantastic!" } );
|
||||
wcSubscription.unsubscribe();
|
||||
|
||||
|
|
@ -86,8 +86,9 @@ $( function () {
|
|||
|
||||
// Using withDelay() to delay the subscription evaluation
|
||||
var wdSubscription = channel.subscribe( "He.Will.Knock.Four.Times",function ( data ) {
|
||||
$( "<li>" + data.value + "</li>" ).appendTo( "#example8" );
|
||||
$( "<li>" + data.value + "(Received at: " + new Date() + ")</li>" ).appendTo( "#example8" );
|
||||
} ).withDelay( 5000 );
|
||||
$( "<li>Publishing Started at: " + new Date() + "</li>" ).appendTo( "#example8" );
|
||||
channel.publish( "He.Will.Knock.Four.Times", { value : "Knock!" } );
|
||||
channel.publish( "He.Will.Knock.Four.Times", { value : "Knock!" } );
|
||||
channel.publish( "He.Will.Knock.Four.Times", { value : "Knock!" } );
|
||||
|
|
|
|||
Loading…
Reference in a new issue