Giter VIP home page Giter VIP logo

Comments (7)

katis avatar katis commented on May 18, 2024 1

I know that in Mobx JS enforced actions are disabled by default but I'd suggest that we enabled them by default, especially if we can get async @actions to work. This way making actions to mutate state would be the norm, and making state changes everywhere willy-nilly would be the hacky "quick&dirty" way.

from mobx.dart.

pavanpodila avatar pavanpodila commented on May 18, 2024 1

Agree @katis, let me try that in the next PR. Have a bunch of tests that need to be changed as we are mutating lot of the observables outside actions.

More precisely, ~88 tests will fail 😬 if we enable EnforceActions.always as the default. Currently I have set it to EnforceActions.never

from mobx.dart.

katis avatar katis commented on May 18, 2024

@pavanpodila What about using observed as the default? That's what I use in all my JS projects.

from mobx.dart.

pavanpodila avatar pavanpodila commented on May 18, 2024

Ya, that would be good. Even there about 62 tests are failing

from mobx.dart.

pavanpodila avatar pavanpodila commented on May 18, 2024

I can take it up once we merge this. Please review :-)

from mobx.dart.

katis avatar katis commented on May 18, 2024

If enforceActions were changed to be variable in the context, you could just disable enforcement in the test files.

Edit: nvm, it already is configurable

from mobx.dart.

pavanpodila avatar pavanpodila commented on May 18, 2024

Fixed in #88. Will open a separate issue for a stricter enforcement

from mobx.dart.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.