Skip to content

ember-polyfills/ember-richgt-test-package-do-not-use

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ember-richgt-test-package-do-not-use

CI npm version Download Total Ember Observer Score code style: prettier Dependabot enabled dependencies Status devDependencies Status

Polyfill for RFC 566 "@cached decorator".

Installation

ember install ember-richgt-test-package-do-not-use

For addons, pass the -S flag.

Compatibility

  • Ember.js v3.13 or above
  • Ember CLI v2.13 or above
  • Node.js v10 or above

Summary

Add a @cached decorator for memoizing the result of a getter based on autotracking. In the following example, fullName would only recalculate if firstName or lastName is updated.

import { tracked, cached } from '@glimmer/tracking';

class Person {
  @tracked firstName = 'Jen';
  @tracked lastName = 'Weber';

  @cached
  get fullName() {
    return `${this.firstName} ${this.lastName}`;
  }
}

For detailed usage instructions, refer to the RFC 566 "@cached decorator".

TypeScript Usage

TypeScript's normal type resolution for an import from @glimmer/tracking will not find the types provided by this polyfill, since the actual @glimmer/tracking package does not include an export for cache.

In order for TypeScript to recognize the extra cache export, add an import like this somewhere in your codebase (like app.ts or test-helper.ts):

import 'ember-richgt-test-package-do-not-use';

Once the upstream types have been updated to reflect RFC 566, this will no longer be necessary.

About

Test package for working on automated releases. Do not use.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 46.5%
  • TypeScript 45.3%
  • HTML 8.0%
  • Handlebars 0.2%