-
Notifications
You must be signed in to change notification settings - Fork 0
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
refactor: loan manager user loan type #107
Conversation
🦋 Changeset detectedLatest commit: d52a736 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
const colPools = [...structuredClone(oldColPools)]; | ||
const borPools = [...structuredClone(oldBorPools)]; | ||
const collaterals = [...structuredClone(oldCollaterals)]; | ||
const borrows = [...structuredClone(oldBorrows)]; | ||
const userLoanCollateral = [...structuredClone(oldCollaterals)]; | ||
const userLoanBorrow = [...structuredClone(oldBorrows)]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think there is a need for [...]
syntax anymore since the type is no longer readonly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep, thanks 5b8796a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@palace22 I think you still need to use structuredClone, but this way without the spread:
const colPools = structuredClone(oldColPools);
const borPools = structuredClone(oldBorPools);
const collaterals = structuredClone(oldCollaterals);
const borrows = structuredClone(oldBorrows);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here the reason why #85 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@stefanofa thanks updated, d52a736
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@palace22 maybe it could be even better to do:
const {
accountId,
loanTypeId,
colPools,
borPools,
userLoanCollateral,
userLoanBorrow,
} = structuredClone(loan);
wdyt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated. # Releases ## @folks-finance/[email protected] ### Patch Changes - [#109](#109) [`dd97c21`](dd97c21) Thanks [@palace22](https://github.com/palace22)! - Added read user loans info example - [#107](#107) [`795e926`](795e926) Thanks [@palace22](https://github.com/palace22)! - Refactored LoanManagerUserLoan type Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
No description provided.