Skip to content
This repository has been archived by the owner on Feb 23, 2022. It is now read-only.

Write a lint rule that prevents endless loops #1

Open
sockeqwe opened this issue Jul 31, 2018 · 0 comments
Open

Write a lint rule that prevents endless loops #1

sockeqwe opened this issue Jul 31, 2018 · 0 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@sockeqwe
Copy link
Contributor

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.

@sockeqwe sockeqwe added the enhancement New feature or request label Jul 31, 2018
@sockeqwe sockeqwe added the help wanted Extra attention is needed label Oct 22, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request help wanted Extra attention is needed
Development

No branches or pull requests

1 participant