1.0.2 • Published 4 years ago

@slick-for/builder v1.0.2

Weekly downloads
1
License
ISC
Repository
-
Last release
4 years ago

Slick-For/builder

use this module to create builder classes. You can swap out the implementation pretty easily.

@builder
class Person{

    constructor(){

    }
    speak(){
        return "hello"
    }
}

@builder
class Woman extends Person{
    speak(){
        return "well, hello"
    }
}

You can get the instance of person as such

    const words = Factory.get(Person).speak()
    expect(words).toBe("hello")

Swap to a different implementation

    Factory.use(Person,Woman);
    const words = Factory.get(Person).speak()
    expect(words).toBe("well, hello")
1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago