Skip to content

Commit

Permalink
chore(dependencies): upgrade dependencies
Browse files Browse the repository at this point in the history
BREAKING CHANGE:
The peer dependencies have been upgraded to be:
* "rxjs": "^5.4.2",
* "@angular/core": "^4.3.0",
* "@ngrx/store": "^2.2.3"

close ngrx#2, close ngrx#3
  • Loading branch information
julienevano committed Jul 24, 2017
1 parent dd18a17 commit dc19878
Show file tree
Hide file tree
Showing 15 changed files with 4,530 additions and 102 deletions.
23 changes: 23 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<a name="2.0.0"></a>
# [2.0.0](https://github.com/ngrx/notify/compare/v1.0.0...v2.0.0) (2017-07-22)


### Chores

* **dependencies:** upgrade dependencies ([8592504](https://github.com/ngrx/notify/commit/8592504)), closes [#2](https://github.com/ngrx/notify/issues/2) [#3](https://github.com/ngrx/notify/issues/3)


### BREAKING CHANGES

* **dependencies:** The peer dependencies have been upgraded to be:
* "rxjs": "^5.4.2",
* "@angular/core": "^4.3.0",
* "@ngrx/store": "^2.2.3"



<a name="1.0.0"></a>
# 1.0.0 (2016-06-07)



61 changes: 40 additions & 21 deletions karma.conf.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
var path = require('path');
var webpack = require('webpack');

module.exports = function(karma) {
'use strict';
Expand All @@ -18,16 +19,17 @@ module.exports = function(karma) {
'tests.js': ['coverage', 'webpack', 'sourcemap']
},

reporters: ['mocha', 'coverage'],
reporters: ['mocha', 'coverage-istanbul'],

coverageReporter: {
dir: 'coverage/',
subdir: '.',
reporters: [
{ type: 'text-summary' },
{ type: 'json' },
{ type: 'html' }
]
coverageIstanbulReporter: {
dir: path.join(__dirname, 'coverage'),
reports: [
'html',
'lcovonly',
'json',
'clover'
],
fixWebpackSourcePaths: true
},

browsers: ['Chrome'],
Expand All @@ -41,32 +43,49 @@ module.exports = function(karma) {

webpack: {
devtool: 'inline-source-map',
entry: undefined,
resolve: {
root: __dirname,
extensions: ['', '.ts', '.js']
extensions: ['.ts', '.js'],
modules: [
path.join(__dirname),
'node_modules'
]
},
module: {
loaders: [
rules: [
{
test: /\.ts?$/,
exclude: /(node_modules)/,
loader: 'ts-loader?target=es5&module=commonjs'
}
],
postLoaders: [
use: [
{
loader: 'ts-loader?target=es5&module=commonjs'
}
]
},
{
test: /\.(js|ts)$/, loader: 'istanbul-instrumenter-loader',
test: /\.(js|ts)$/,
enforce: 'post',
include: path.resolve(__dirname, 'lib'),
exclude: [
/\.(e2e|spec)\.ts$/,
/node_modules/
],
use: [
{
loader: 'istanbul-instrumenter-loader'
}
]
}
]
},
ts: {
configFileName: './spec/tsconfig.json'
}
plugins: [
new webpack.LoaderOptionsPlugin({
options: {
ts: {
configFileName: './spec/tsconfig.json'
}
}
})
]
},

webpackServer: {
Expand Down
2 changes: 1 addition & 1 deletion lib/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export { Notify } from './notify';
export { NOTIFY_PROVIDERS, NOTIFY_GLOBAL_OPTIONS } from './ng2';
export { NotifyModule, NOTIFY_GLOBAL_OPTIONS } from './ng2';
export { NotificationInstance, NotificationOptions } from './notification';
23 changes: 14 additions & 9 deletions lib/ng2.ts
Original file line number Diff line number Diff line change
@@ -1,37 +1,36 @@
import { OpaqueToken } from '@angular/core';
import { InjectionToken, NgModule } from '@angular/core';

import { Notify } from './notify';
import { NotificationStatic, NotificationOptions } from './notification';
import { NotificationPermission } from './notification-permission';

declare var Notification: NotificationStatic;
export declare var Notification: NotificationStatic;

export const NOTIFY_GLOBAL_OPTIONS = new OpaqueToken('[@ngrx/notify] Global Options');
export const NOTIFICATION_STATIC = new OpaqueToken('[@ngrx/notify] Notification Static Constructor');
export const NOTIFY_GLOBAL_OPTIONS = new InjectionToken('[@ngrx/notify] Global Options');
export const NOTIFICATION_STATIC = new InjectionToken('[@ngrx/notify] Notification Static Constructor');


const NOTIFICATION_STATIC_PROVIDER = {
export const NOTIFICATION_STATIC_PROVIDER = {
provide: NOTIFICATION_STATIC,
useValue: Notification
};

const NOTIFICATION_PERMISSION_PROVIDER = {
export const NOTIFICATION_PERMISSION_PROVIDER = {
provide: NotificationPermission,
deps: [ NOTIFICATION_STATIC ],
useFactory(Notification: NotificationStatic) {
return new NotificationPermission(Notification);
}
};

const NOTIFY_PROVIDER = {
export const NOTIFY_PROVIDER = {
provide: Notify,
deps: [ NOTIFICATION_STATIC, NOTIFY_GLOBAL_OPTIONS, NotificationPermission ],
useFactory(Notification: NotificationStatic, options: NotificationOptions[], permission$: NotificationPermission) {
return new Notify(Notification, options, permission$);
}
};

const DEFAULT_GLOBAL_OPTIONS_PROVIDER = {
export const DEFAULT_GLOBAL_OPTIONS_PROVIDER = {
provide: NOTIFY_GLOBAL_OPTIONS,
multi: true,
useValue: {}
Expand All @@ -43,3 +42,9 @@ export const NOTIFY_PROVIDERS: any[] = [
NOTIFY_PROVIDER,
DEFAULT_GLOBAL_OPTIONS_PROVIDER
];

@NgModule({
providers: NOTIFY_PROVIDERS
})
export class NotifyModule {
}
6 changes: 5 additions & 1 deletion lib/notification.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
export type NotificationPermissionStatus = 'denied' | 'granted' | 'default';
export enum NotificationPermissionStatus {
DENIED = 'denied',
GRANTED = 'granted',
DEFAULT = 'default'
}

export interface NotificationOptions {
dir?: 'auto' | 'ltr' | 'rtl';
Expand Down
8 changes: 3 additions & 5 deletions lib/notify.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import 'rxjs/add/operator/cache';
import 'rxjs/add/operator/mergeMap';
import 'rxjs/add/observable/throw';
import 'rxjs/add/operator/mergeMap';
import 'rxjs/add/operator/share';
import { Observable } from 'rxjs/Observable';
import { Subscriber } from 'rxjs/Subscriber';

import { NotificationStatic, NotificationOptions, NotificationInstance } from './notification';


export class Notify {
private _permission$: Observable<boolean>;

Expand All @@ -15,7 +13,7 @@ export class Notify {
private globalOptions: NotificationOptions[],
permission$: Observable<boolean>
) {
this._permission$ = permission$.cache();
this._permission$ = permission$.share();
}

requestPermission(): Observable<boolean> {
Expand Down
Loading

0 comments on commit dc19878

Please sign in to comment.