[breaking change] accept an object instead of a function
1.0.0