README
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")