Closed danielweck closed 2 weeks ago
take
support the toString
with StringableActionCreator
ah thanks! phew! :)
that being said, this fact is obfuscated and inconsistent with the many other places in Thorium's codebase where take() uses the ID directly instead of via build().toString() ...let's do a quick code scan to see where else this is used.
ah thanks! phew! :)
that being said, this fact is obfuscated and inconsistent with the many other places in Thorium's codebase where take() uses the ID directly instead of via build().toString() ...let's do a quick code scan to see where else this is used.
One day we will switch to the latest rtk api ! :) I hope :)
I don't think it's a good choice to force use .ID
instead of .build
we lost type checking for the takeEveryTyped
function.
I think we have to revert this commit https://github.com/edrlab/thorium-reader/pull/2640/commits/dd38b5c1241edfb5f8f83e612834d3e2d9de0533
Our type checking api is not ready to use .ID
only
ah, I verified "npm run build:prod" before merging! do you get this error in the develop branch??
I made this error, to prove action type checking is no longer checked/inferred
I see. In the meantime I was looking at the codebase again, it would be better to be consistent the other way around: only use .build
, not .ID
:)
Hello @panaC in the code diff you will see:
1) the obvious
isDestroyed
code fencing / sanity checks 2)yield take(winActions.library|reader.openSucess.build)
replaced withyield take(winActions.library|reader.openSucess.ID)
(I can't believe this passed compilation! no idea what the runtime behaviour was/is??) 3)"did-finish-load"
ALWAYS used, not just inDEV
mode otherwise there can be differences with the production builds which we do not test as much as the development builds. Consequently I commented theyield put(winActions.library|reader.openSucess...
immediately after theloadUrl
, and also to improve code legibility I positioned the"did-finish-load"
event handler BEFORE theloadUrl
(consistent for both reader and library windows)