Git Product home page Git Product logo

Comments (6)

fedorl avatar fedorl commented on May 31, 2024

The readme still shows incorrect StoreModule.forRoot(reducers, { metaReducers }) code, not sure why it was closed.

from ngrx-store-freeze.

brandonroberts avatar brandonroberts commented on May 31, 2024

The example is not incorrect because the two are equivalent. Its object shorthand for property names.

from ngrx-store-freeze.

fedorl avatar fedorl commented on May 31, 2024

You are right in the sense that it would work in this particular case, incorrect probably is not the proper wording. Still, I think it is a bad practice assuming the same name for property in parameter type and a variable/const name completely unrelated to parameters type, especially in library example doc. If metaReducers is renamed differently in an application, say, appMetaReducers, this shorthand will be broken.

from ngrx-store-freeze.

brandonroberts avatar brandonroberts commented on May 31, 2024

That's what type checking is for. The options object does not include an appMetaReducers object property and would throw a compile time error.

from ngrx-store-freeze.

fedorl avatar fedorl commented on May 31, 2024

I would not argue, technically you are right and this is minor. But note, with full syntax, rename refactoring will not cause any problem, it would just work without any compile error and developer time or attention. I think given two alternatives more robust and safer one is a better practice and library examples deserve such one )

from ngrx-store-freeze.

brandonroberts avatar brandonroberts commented on May 31, 2024

I can agree with that. Care to submit a PR for the minor change?

from ngrx-store-freeze.

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.