Skip to content

Refactor <AccessType> component #145

Open
@asimqt

Description

There are some architectural issues with our current <AccessType> component which I'm noting here: These issues made working with the component hard:

  1. 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.
  2. API calls like this.getPaymentOptions() should be cached in memory.
  3. There should be more exposed helper functions like setUser and getJWTToken and try to memoize the results.

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions