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

export function backing "evaluate" property #430

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sritchie
Copy link

@sritchie sritchie commented Jan 11, 2023

Here were my Discord notes backing this request. Not sure what you think of the name, or if my export here is actually valid JS syntax... let me know!

"I have an example going with the Bezier plugin, and noticed that the returned value is an array of four entries, BUT ALSO used as an object, with a couple of keys added for (I think) evaluate etc.

This is convenient... but these keys don't survive conversion to ClojureScript, and the code isn't structured to make it easy to recover those values with only the 4 bezier curve entries.

What do you think of restructuring the code to export an evaluate function that takes the array of 4 entries as well as a point? we can keep the current behavior, but the change would let me evaluate without the plugin internally building that evaluate function for me."

@changeset-bot
Copy link

changeset-bot bot commented Jan 11, 2023

⚠️ No Changeset found

Latest commit: 08ea396

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel
Copy link

vercel bot commented Jan 11, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
leva ❌ Failed (Inspect) Jan 11, 2023 at 2:27PM (UTC)

@codesandbox-ci
Copy link

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 08ea396:

Sandbox Source
leva-minimal Configuration
leva-busy Configuration
leva-scroll Configuration
leva-advanced-panels Configuration
leva-ui Configuration
leva-theme Configuration
leva-transient Configuration
leva-plugin-plot Configuration
leva-plugin-bezier Configuration
leva-plugin-spring Configuration
leva-plugin-dates Configuration
leva-custom-plugin Configuration

@sritchie
Copy link
Author

If you like this, I'd also like to turn the code that generates the cssEasing string https://github.com/pmndrs/leva/blob/main/packages/plugin-bezier/src/bezier-plugin.ts#L31 into a function in bezier-utils.ts and export that as well. Then users can still proceed even if they don't use the kv pairs added to the array.

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.

1 participant