Skip to content

Instantly share code, notes, and snippets.

@holyshared
holyshared / main.ts
Created May 18, 2021
awilix example
View main.ts
import { createContainer, asValue, asFunction, asClass } from "awilix";
// 関数で生成する
// 引数は予めコンテナで設しておく
const loggerFactory = ({ path }: { path: string }) => {
return {
path
};
};
View consumed_pattern.js
const al = (n) => {
let r = n;
for (let i = 1; i <= n - 1; i++) {
r = r * i;
}
return r;
};
console.log(al(2));
console.log(al(3));
View pattern.js
const items = [1, 2, 3];
function pattern(items, paths, results) {
if (items.length === 0) {
results.push([ ...paths ]);
return results
}
let curr = results;
for (let i = 0; i < items.length; i++) {
paths.push(items[i]);
View README.md

blueimp-load-image example

View .editorconfig
[*.js]
indent_style = space
indent_size = 2