Skip to content

Про инициализацию обязательных параметров отметить #8

Open
@Alex009

Description

class AuthFormSmsCodeViewModel(
    val eventsDispatcher: EventsDispatcher<EventsListener>,
    val exceptionHandler: ExceptionHandler,
    private val authRepository: AuthRepository,
    private val strings: Strings
) : ViewModel() {    
    private var phone: String = ""
    private var key: String = ""
    private var authType: AuthType = AuthType.SIGN_UP    

    fun setInitialAuthData(phone: String, key: String, authType: AuthType) {
        this.phone = phone
        this.key = key
        this.authType = authType
    }

bad code

class AuthFormSmsCodeViewModel(
    val eventsDispatcher: EventsDispatcher<EventsListener>,
    val exceptionHandler: ExceptionHandler,
    private val authRepository: AuthRepository,
    private val strings: Strings,
    private val phone: String,
    private val key: String,
    private val authType: AuthType
) : ViewModel() {    

}

good code

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions