This PR adds _experimental_updateFunc to frontloadConnects options, as discussed in #33 .
I decided to make this a function instead of an array of prop keys to keep as much logic out of frontload as possible, as well as give users a little more control.
updateFunc should take the components prevProps and newProps as arguments and return true if the frontload function should run. This gives the ability to specify exactly when the frontload function should should run on update, without using additional middleware components.
This PR adds
_experimental_updateFunc
to frontloadConnects options, as discussed in #33 . I decided to make this a function instead of an array of prop keys to keep as much logic out of frontload as possible, as well as give users a little more control.updateFunc
should take the componentsprevProps
andnewProps
as arguments and return true if the frontload function should run. This gives the ability to specify exactly when the frontload function should should run on update, without using additional middleware components.Example: Update only when the
id
prop changes.