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/137/v12 v13 support #145

Merged
merged 15 commits into from Nov 6, 2021
Merged

Feat/137/v12 v13 support #145

merged 15 commits into from Nov 6, 2021

Conversation

SimonMcKinsey
Copy link
Member

@SimonMcKinsey SimonMcKinsey commented Nov 5, 2021

@adamkleingit I've separated migration to small portions.
Angular v13 is now working with mobx newest version.
Fully tested.

However, I was forced to add to bank-v13 application the following:
makeAutoObservable(this);

Full snippet under account.store.ts:

  constructor() {
    if (localStorage.savedTransactions) {
      this.transactions = JSON.parse(localStorage.savedTransactions);
    }

    makeAutoObservable(this);

    autorun(() => {
      localStorage.savedTransactions = JSON.stringify(this.transactions);
    });
  }

Without it it wouldn't work.
I found the solution in this example: reactions.

Also, it seems like autorun is not encouraged with class component. Source: stackoverflow

I need a clarification on this one.
If everything seems legit, then I'll update the README as well with this new use case.

What am I missing here?

Thanks ahead.

Edit (06/11/2021): As I suspected, @EVASIVE suggested the same in his PR: #138

I'll update README

@github-actions
Copy link

github-actions bot commented Nov 5, 2021

Size Change: 0 B

Total Size: 0 B

compressed-size-action

@SimonMcKinsey SimonMcKinsey removed the request for review from adamkleingit November 6, 2021 14:06
@SimonMcKinsey SimonMcKinsey merged commit b6b45c8 into master Nov 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant