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

Documentation incorrect on adding records #886

Closed
bradjones1 opened this issue Aug 20, 2021 · 2 comments
Closed

Documentation incorrect on adding records #886

bradjones1 opened this issue Aug 20, 2021 · 2 comments

Comments

@bradjones1
Copy link
Contributor

When following the documentation at https://orbitjs.com/docs/next/updating-data#transforms for adding a record, if you use the snippet as-is, with the arrow function returning t.addRecord() directly, Orbit 0.17 beta fails with

Unhandled Rejection (TypeError): transform is undefined in isTransform at /src/transform.ts:113

I noticed the snippet just below, where you can return an array of transforms, and tried that instead (basically, an array of one.) This works.

is this a BC break in 0.17 from a previous behavior, or are the docs wrong?

@dgeb
Copy link
Member

dgeb commented Aug 21, 2021

@bradjones1 can you provide a reproduction, perhaps based on this codesandbox ?

Both of the following forms (single operation / array of operations) appear to be working with v0.17-beta.25:

  await memory.update((t) => t.addRecord(jupiter));

  await memory.update((t) => [
    t.addRecord(earth),
    t.addRecord(venus),
    t.addRecord(io),
    t.addRecord(europa),
    t.addRecord(theMoon)
  ]);

@bradjones1
Copy link
Contributor Author

I can no longer recreate this.

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

No branches or pull requests

2 participants