Menhera
an experimental lovely frame
Install
yarn add menhera
Example
import Menhera from "menehra";
const test = ({ _val }) => console.log(_val);
const testFn = ({ _val }) => console.log(_val());
const testEach = ({ _val }) => {
typeof _val === "function" && testFn({ _val });
typeof _val !== "function" && test({ _val });
};
const testRoot = ({ _val }) => {
for (let [key, val] of Object.entries(_val)) {
testEach({ _val: val });
}
};
const _ = new Menhera({
_hooks: {
foo: {
bar: {
foo1: {
bar1: {
$: testEach,
_: testRoot,
test,
testFn
}
}
}
}
},
foo: {
bar: {
foo1: {
bar1: {
test: "foo bar",
testFn: () => "foo bar"
}
}
}
}
});
import { core } from "menhera";
class Foo {
constructor() {}
}
const Bar = parms => core({ _: new Foo(), parms });
const _ = new Bar({});