@ethf/core
TypeScript icon, indicating that this package has built-in type declarations

0.5.0 • Public • Published

@ethf/core

@ethf/core 提供了对插件的支持。

Installation

pnpm i @ethf/core

Demo

import { createInstance, XCore } from "@ethf/core"

class Base extends XCore {}

const plugin = 
    (base: new () => Base) => class extends base {
        a: number = 10
        printA() {
            console.log(`a = ${this.a}`)
        }
    }

const instance = createInstance(Base, [ plugin ])

instance.printA() // expect to be 'a = 10'
instance.a = 20
instance.printA() // expect to be 'a = 20'

Documentation

Api文档参考

Readme

Keywords

none

Package Sidebar

Install

npm i @ethf/core

Weekly Downloads

4

Version

0.5.0

License

MIT

Unpacked Size

8.26 kB

Total Files

9

Last publish

Collaborators

  • zecyel