Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: morph/react make use of granular functions when morphing data block #241

Merged
merged 1 commit into from
May 17, 2021

Conversation

alex-vladut
Copy link
Contributor

I tried to update the morphing of the data blocks so that instead of making use of the old useData function it will utilise the new granular functions which will be added in the other PR.

@alex-vladut alex-vladut force-pushed the block-data-use-functions branch from db029a8 to 93e5b4b Compare May 14, 2021 14:02
@alex-vladut
Copy link
Contributor Author

@dariocravero I updated the PR as per our discussion yesterday to only morph the relevant useDataX hooks. I tried as well to add an error message in case the developer is referencing a property which is not available like isValid on a constant or aggregate data, but not sure this is the right way to handle such errors or maybe there is a better way, added something like this:

    if (propValue === 'value') {
      return dataGroup.data[0].name
    } else {
      throw new Error(
        `Property ${propValue} is not available on constant data, only "value" is a valid option`
      )
    }

@dariocravero
Copy link

Amazing work @alex-vladut!!!
It works really well :) 👇 my tests 😜
Screenshot 2021-05-14 at 18 45 31

Spotted a tiny thing but put it up as another issue, not a blocker at all for this #242

@alex-vladut alex-vladut force-pushed the block-data-use-functions branch from 93e5b4b to 70bb638 Compare May 17, 2021 07:43
@alex-vladut alex-vladut merged commit 36bb4a3 into master May 17, 2021
@alex-vladut alex-vladut deleted the block-data-use-functions branch May 17, 2021 08:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants