Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Paste
P6342
(An Untitled Masterwork)
Active
Public
Actions
Authored by
EBernhardson
on Nov 17 2017, 4:08 PM.
Edit Paste
Archive Paste
View Raw File
Subscribe
Mute Notifications
Award Token
Flag For Later
Tags
None
Referenced Files
F10847056:
Nov 17 2017, 4:08 PM
2017-11-17 16:08:05 (UTC+0)
Subscribers
None
const BeforeOnce = ( options, fn ) => Before( options, function () {
return this.tags.check( options.tags ).then( ( status ) => {
if ( status === 'new' ) {
return fn.call ( this ).then( () => this.tags.complete( options.tags ) );
}
} );
} );
Converted to couroutine:
const BeforeOnce = ( options, fn ) => Before( options, Promise.coroutine( function* () {
let status = yield this.tags.check( options.tags );
if ( status === 'new' ) {
yield fn.call( this );
yield this.tags.complect( options.tags );
}
} ) );
Event Timeline
EBernhardson
created this paste.
Nov 17 2017, 4:08 PM
2017-11-17 16:08:05 (UTC+0)
Log In to Comment