You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are some architectural issues with our current <AccessType> component which I'm noting here: These issues made working with the component hard:
on componentDidMount we're calling initAccessType which makes the subsequent calls like this.getSubscription() and this.getPaymentOptions() always happening if somehow the component is re-mounted. This is not needed as we should let the users of the component decide when to call initAccessType as we're exposing it through renderProp anyway. The component calling itself counter the full renderProp idea.
Note: when removing make sure the users of <AccessType> are calling initAccessType explicitly when needed.
API calls like this.getPaymentOptions() should be cached in memory.
There should be more exposed helper functions like setUser and getJWTToken and try to memoize the results.
The text was updated successfully, but these errors were encountered:
There are some architectural issues with our current
<AccessType>
component which I'm noting here: These issues made working with the component hard:componentDidMount
we're callinginitAccessType
which makes the subsequent calls likethis.getSubscription()
andthis.getPaymentOptions()
always happening if somehow the component is re-mounted. This is not needed as we should let the users of the component decide when to callinitAccessType
as we're exposing it through renderProp anyway. The component calling itself counter the full renderProp idea.Note: when removing make sure the users of
<AccessType>
are callinginitAccessType
explicitly when needed.this.getPaymentOptions()
should be cached in memory.setUser
andgetJWTToken
and try to memoize the results.The text was updated successfully, but these errors were encountered: