ES6/7 Decorator alternative
See original GitHub issueI see in the example (https://github.com/tiberiuc/redux-react-firebase/blob/master/example/App.js)
@firebase()
and then later:
@firebase( [
'/todos', // if list is too large you can use ['/todos']
])
I’m not sure why this happens twice, and what the decorator does exactly, and what the alternative would be with ES5.
Also, the comment // if list too large you can use ['/todos'] I don’t understand what this means, can you elaborate? (there is no difference in '/todos')
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Exploring EcmaScript Decorators
Yehuda's decorators proposal seeks to enable annotating and modifying JavaScript classes, properties and object literals at design time while keeping a syntax ...
Read more >ES-67 Oxford Brown ARBORCOAT Semi-Solid Exterior Color
ES-67 Oxford Brown ARBORCOAT Semi-Solid Exterior Color. Price: $73.18 (Price Includes NYS PaintCare Fee). Use Code SAVE20 In Shopping Cart To Save 20%...
Read more >Alternatives to decorator pattern on data object arrays
Writing angular services, i found a pattern that i consider very convenient. I think it fits into the description of the decorator pattern....
Read more >DEFY Extreme Acrylic Custom Solid Color Wood Stain
Use of alternative products or methods prior to sealing may produce unsatisfactory final results. DEFY Extreme Solid Wood Stain is sold in one...
Read more >Decorate your code with TypeScript decorators | by Mohan Ram
Decorators are a proposed standard for ECMAScript 2016 by Yehuda Katz. We can pass user arguments to the decorator via decorator factories. ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@TrySpace the simple example of redux-firebasev3 shows implementing without decorators where the decorators example (interface is the same as this library)
Simple comparison:
With Decorators
Without Decorators
I bet that @tiberiuc will add a similar example showing this in the future (he is just now back around).
first version
it is the equivalent for
firebase.ref.child('/todos').on('value', ..... )that mean it will listen for value and each time a todo will change it will fetch the entire /todos tree as a single value. The problem is when you have a lot of todos, firebase have a limit of 10mb / nodewhile
it is the equivalent for
and it will fetch each todo item one by one and also listen for removed, changed, … events and is setting them into redux store one by one
the result of each version it is the same, the difference it is how it is fetching the results from firebase and of course when you have huge data ( more then 10mb ) then first version will just not work
let me know if you have any other questions