Any help would be greatly appreciated
# redux
m
Any help would be greatly appreciated
p
were you able to get this working?
m
I was not. I just settled for only having one callback at a time. I really need two
but in the short term, I'm making it work
Do you have any idea how to do this?
p
no, I am not real familiar with react. I would search for how this is done in reactJs and match that pattern in kotlin if possible
m
Yeah I'm going to look into it more in the future
right now though, I'm ripping towards a deadline
so I'm making it work as is
thanks for checking in though
p
@Robert Jaros or @willyrs do you have experience with this?
r
Unfortunately no.
m
I fixed this. It was super simple actually, and I feel dumb for struggling with it at first. You can just pass the generic RAction as the type instead of the specific action extending it.
So you get something like this:
Copy code
private interface ValidateFilesButtonStateProps : RProps {
    var cliContext: CliContext
    var uploadedFiles: List<ValidationOutcome>
}

private interface ValidateFilesButtonDispatchProps : RProps {
    var addValidationOutcome: (ValidationOutcome) -> Unit
    var toggleValidationInProgress: (Boolean, FileInfo) -> Unit
}

val validateFilesButton: RClass<RProps> =
    rConnect<AppState, RAction, WrapperAction, RProps, ValidateFilesButtonStateProps, ValidateFilesButtonDispatchProps, ValidateFilesButtonProps>(
        { state, _ ->
            cliContext = state.cliContext
            uploadedFiles = state.uploadedFiles
        },
        { dispatch, _ ->
            addValidationOutcome = { dispatch(AddValidationOutcome(it)) }
            toggleValidationInProgress = { b: Boolean, fileInfo: FileInfo -> dispatch(ToggleValidationInProgress(b, fileInfo)) }
        }
    )(ValidateFilesButton::class.js.unsafeCast<RClass<ValidateFilesButtonProps>>())
p
Glad you got it working 👍
m
heh, same here
thanks for actually being active in the community
I keep asking questions in the other channels and no one responds
only low ball questions get swarmed
even if you don't know the answer, it's nice to talk it out
p
Sure thing. I'll be a rubber duck 🙂 I take it as a opportunity to learn something and meet people
m
👌