confetti icon indicating copy to clipboard operation
confetti copied to clipboard

Split init logic, exclude View dependencies from constructor

Open BlackDizel opened this issue 4 years ago • 0 comments

For example, if you want to init Confetti in some util class on presenters layer, maybe you want to wrote something like this:

util class:
fun initParticles() = ConfettiManager(params)
view class like activity, fragment or custom view:
fun showParticles(particles: ConfettiManager){
  particles.animate(view)
}
presenter class:
fun initParticles(){
  view.showParticles(util.initParticles())
}

BlackDizel avatar Feb 26 '21 14:02 BlackDizel