1.1.2 • Published 5 years ago

@btilford/ts-base-browser v1.1.2

Weekly downloads
10
License
MIT
Repository
github
Last release
5 years ago

ts-base-browser

Installation

npm install --save @btilford/ts-base-browser

Features

Load Env data from the DOM

<html>
<head>
<meta name="cfg:appOptions:x" content="abc">
<meta name="cfg:LEVEL" content="debug">
</head>
<body>
<script>
import {Env} from '@btilford/ts-base';
import {loadEnvWithMetaTags} from '@btilford/ts-base-browser';
const env = Env.load([
  loadEnvWithMetaTags('cfg:', document);
]);
console.assert(env.getConfig('appOptions:').x === 'abc');
console.assert(env.getProp('LEVEL') === 'debug');
</script>
</body>
</html>

Timer for Performance API

There is a Timer implementation that records marks and measures to window.performance. It can be used with the @Timed() and @TimedAsync() decorators.

import {Timed, bootstrap} from '@btilford/ts-base';
import {PerformanceTimerFactory} from '@btilford/ts-base-browser';



bootstrap({
  appName:'my-app',
  apm: {
    features: {
      timer: new PerformanceTimerFactory({})
    } 
  } 
});


class Example {
  @Timed() // Record time for calls to this function.  
  method() {
    console.log('called');
  } 
}

See ts-base for additional information.

1.1.2

5 years ago

1.1.1

5 years ago

1.1.1-0

5 years ago

1.1.0

5 years ago

1.0.0

5 years ago

0.1.0

5 years ago

0.0.7

5 years ago

0.0.6

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago