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

Add example with mobx #644

Closed
rauchg opened this issue Jan 3, 2017 · 13 comments
Closed

Add example with mobx #644

rauchg opened this issue Jan 3, 2017 · 13 comments
Assignees

Comments

@rauchg
Copy link
Member

rauchg commented Jan 3, 2017

Some people have had issues using it, so it'd be great to have an example. It's a bit more involved than others since it requires decorator support, so it'll impose a .babelrc

@arunoda
Copy link
Contributor

arunoda commented Jan 4, 2017

@rauchg I hope there's a way to use mobx without decorators too.

@fdidron
Copy link
Contributor

fdidron commented Jan 4, 2017

Yes it is possible to use it without decorators, I have an example here:

https://github.com/fdidron/mobx-next-example | https://mobx-next.now.sh/

(It includes a lot of other stuff I discovered when using next for the first time :D, maybe a simpler example would be more suited)

EDIT: Mobx documentation has a very interesting part on how NOT to use decorators : http://mobxjs.github.io/mobx/best/decorators.html

@arunoda
Copy link
Contributor

arunoda commented Jan 4, 2017

@fdidron the question is how many of mobx users decorators or not.
If most of the users use decorators, we need to use decorators in our example.

@mweststrate
Copy link

Yes it a majority that uses it, I did a poll a while back if I remember correctly it was 70-ish percent, so including decorators as example would be greatly appreciated!

Btw, mobx-state-tree might be very interesting in the future for next as well, as it provides a unified way how to serialize and transfer state (and it is decorator free ;-))

@arunoda
Copy link
Contributor

arunoda commented Jan 4, 2017

@mweststrate thanks. 70% is the majority :)
I think then we should add an example with a decorator.

@fdidron
Copy link
Contributor

fdidron commented Jan 4, 2017

@arunoda I'm very happy to help on the example using decorators. Would it make sense to simply port the "with-redux" example ?

@arunoda
Copy link
Contributor

arunoda commented Jan 4, 2017

@fdidron yeah! That'd be awesome.

@cncolder
Copy link
Contributor

cncolder commented Jan 4, 2017

Is this so hard to add decorators?
I only put a .babelrc and it just worked.

{
  "presets": [
    "next/babel"
  ],
  "plugins": [
    "transform-decorators-legacy"
  ]
}

@arunoda
Copy link
Contributor

arunoda commented Jan 4, 2017

@cncolder Nope. It's not that hard :)

@aranajhonny
Copy link
Contributor

simple example using decorators.
https://github.com/aranajhonny/next-with-mobx
demo --> https://next-with-mobx-bnmkseetwa.now.sh/

@ugiacoman
Copy link

@aranajhonny Very simple, thank you!

@fdidron
Copy link
Contributor

fdidron commented Jan 6, 2017

@arunoda Here is a PR #676

@arunoda
Copy link
Contributor

arunoda commented Jan 6, 2017

We got the PR.

@arunoda arunoda closed this as completed Jan 6, 2017
@lock lock bot locked as resolved and limited conversation to collaborators May 12, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants