Comments (6)
The readme still shows incorrect StoreModule.forRoot(reducers, { metaReducers }) code, not sure why it was closed.
from ngrx-store-freeze.
The example is not incorrect because the two are equivalent. Its object shorthand for property names.
from ngrx-store-freeze.
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.
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.
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.
I can agree with that. Care to submit a PR for the minor change?
from ngrx-store-freeze.
Related Issues (20)
- Update to NgRx 4 HOT 22
- Project Adoption HOT 4
- Document in README how to create custom RouterStateSerializer HOT 1
- Cannot freeze array buffer views with elements HOT 1
- Freezing the payload can make application crash, expecially with RouterStore HOT 2
- wrongly freeze when an object which has a getter is in the store HOT 1
- Update Peer Dependency to NgRx 5.x
- The objects are getting frozen too soon HOT 7
- Should the storeFreeze replace an undefined state with an empty object?
- ngrx store freeze error HOT 3
- This library assumes that all Action's will have a 'payload' attribute HOT 1
- Why not use in production? HOT 1
- ngrx v6 compatibility HOT 3
- npm WARN [email protected] requires a peer of @ngrx/store@>=4.0.0 but none is installed. You must install peer dependencies yourself. HOT 1
- Required Ngrx/store version 6.0.0-beta.1 HOT 1
- TypeError: Cannot add property, object is not extensible HOT 3
- [Notice] This package will no longer be needed as of NgRx version 8
- Using isDevMode() throws error Function calls are not supported in decorators but 'isDevMode' was called in 'metaReducers'
- Cannot add property _resolvedData, object is not extensible HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ngrx-store-freeze.