I've got a project written in ES6 with webpack as my bundler. Most of the transpiling works fine, but when I try to include decorators anywhere, I get this error:   Decorators are not supported yet in 6.x pending proposal update.   I've loo...
I have a typescript decorator factory which console logs total time taken to execute a function, actual function execution results and parameters passed to the decorator as well.  e.g.   export function performaceLog(...args: any[]) { return (target:...
I am learning Redux with React and stumbled upon this code. I am not sure if it is Redux specific or not, but I have seen the following code snippet in one of the examples.  @connect((state) => {   return {     key: state.a.b   }; })   While the f...
I’m creating simple application using React Redux. I want to use decorator to inject some methods in my component.. I saw similar code in other projects:  import React, { Component } from 'react'; import { connect } from 'react-redux...
I am building a simple mapping between frontend/backend data structure. In order to do that I've created a decorator that looks like the following:  function ApiField(     apiKey: string,     setFn: (any) => any = (ret) => ret,     getFn: (...
Looking at Angular2 projects, I see some are using: npm reflect-metadata  and others are using : core-js/es7/reflect  I know both are implementing the ES7 proposed Decorator and reflect API  But what is the difference between the two? Are they just c...
My web application is using a number of JQuery plugins such as the Datatables, and it's corresponding Row Reordering and Sorting plugins.  The problem is that we need to add some fixes to account for annoying IE8 inconsistencies.  So, for example...
When do decorators get executed?  class Person {     @SomeDecorator     age }    When I create an instance of Person When the Person class is parsed   What about static properties?...
I'm trying to develop a decorator for REST Api Interfaces in Typescript. Here it is the decorator implementation  export function RemoteResource(params: any): Function {     console.log("RemoteResource.params: ", params);     return funct...
I'm writing a backbone application, and I would like to write an authenticated decorator that I can use to decorate a list of methods (routes) in the router class.  So I have a router with a few methods and have tried something like this. However...

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.