This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import notifierQueue from "~/queues/notifier.server.ts"; | |
export const loader = async () => { | |
await notifierQueue.add("test", { emailAddress: "mokhtar@remixtape.dev" }); | |
return null; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Collect headers (h1, h2, ..., hx) from html and generates navigatable, stylable table of contents. | |
@param maxHeaderLevel int Define header level depth, defaults to 3. | |
@param styleItem function Function that accepts text:string, level:int and itemAnchor:string to style toc entry, default renderer is set already (check source for usage). | |
@return string HTML table of contents | |
*/ | |
function generateTableOfContents(maxHeaderLevel = 3, styleItem = function (text, level, itemAnchor) { | |
var spaces = " ".repeat(Math.max(0, (level - 1)) * 3); | |
var tocEntry = spaces + '<a href="#' + itemAnchor + '">' + text + '</a><br/>'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// simple dsl just wrapping angular's dsl, just providing higher abstraction | |
angular.scenario.dsl('submitMessage', function() { | |
return function(message) { | |
// these dsl already register futures (add fn into the queue), | |
// so you don't wrap them into addFutureAction | |
input('modelValue').enter(message); | |
element('button.submit').click(); | |
}; | |
}); |