8000 Write a lint rule that prevents endless loops · Issue #1 · freeletics/RxRedux · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
This repository was archived by the owner on Feb 23, 2022. It is now read-only.
This repository was archived by the owner on Feb 23, 2022. It is now read-only.
Write a lint rule that prevents endless loops #1
Open
@sockeqwe

Description

@sockeqwe

A endless loop that causes a stackoverflow is possible if you write an action that produces the same kind of output as it also consumes as input. Example:

fun sideEffect1(actions : Observable<FooAction>, stateAccessor : StateAccessor<State>) : Observable<FooAction> = 
actions
    .ofType(FooAction::class.java)
    .map { FooAction() } // Endless loop

This reduces a endless loop because output is FooAction which then is also the input for the same SideEffect.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0