8000 GitHub - SuperErnD/mijin: An just function-libary for injecting into methods
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

SuperErnD/mijin

Repository files navigation

Mijin

From Mixin and Inject

An just simple function-library for injecting into methods

Writed to node.js but should just work on browser/deno

warning!!!

use remixin instead, it better (yet :D). mijin will be soon (maybe?) rewritten like remixin

Remixin: https://github.com/soundcloud/remixin/tree/master

You can use it, but it recommended to use with functions, not classes, and also if you inject into class method you cant get this object

!!!

Examples

Node

import mijin from './mijin.js'
const a = () => {
    console.log('Hello world 1')
}

const b = () => {
    console.log('Hello world 2')
}

const c = mijin(a, b, "AFTER")

c()
// Hello world 1
// Hello world 2

Deno

import mijin from 'https://deno.land/x/mijin/mijin.js'
const a = () => {
    console.log('Hello world 1')
}

const b = () => {
    console.log('Hello world 2')
}

const c = mijin(a, b, "AFTER")

c()
// Hello world 1
// Hello world 2

Browser

const a = () => {
    console.log('Hello world 1')
}

const b = () => {
    console.log('Hello world 2')
}

const c = mijin(a, b, "AFTER")

c()
// Hello world 1
// Hello world 2

Build

npm run build
# Now check ./dist!

License

WTFPL

About

An just function-libary for injecting into methods

Resources

Stars

Watchers

For 400B ks

Packages

No packages published
0