Skip to content

Commit 71a521f

Browse files
committed
feat: Updated to latest angular beta (17) and releasing change to support Observable select function
BREAKING CHANGE: Upgraded Redux with Observable and to Angular2.beta17
1 parent 1e14697 commit 71a521f

File tree

3 files changed

+56
-57
lines changed

3 files changed

+56
-57
lines changed

config.js

Lines changed: 36 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,16 @@ System.config({
2727
},
2828

2929
map: {
30-
"angular2": "npm:[email protected].14",
30+
"angular2": "npm:[email protected].17",
3131
"bootstrap": "github:twbs/[email protected]",
3232
"crypto": "github:jspm/[email protected]",
33-
"css": "github:systemjs/[email protected].20",
34-
"redux": "npm:[email protected].1",
33+
"css": "github:systemjs/[email protected].21",
34+
"redux": "npm:[email protected].2",
3535
"redux-thunk": "npm:[email protected]",
3636
"reflect-metadata": "npm:[email protected]",
37-
"rxjs": "npm:[email protected].6",
38-
"typescript": "npm:[email protected].9",
39-
"zone.js": "npm:[email protected].10",
37+
"rxjs": "npm:[email protected].7",
38+
"typescript": "npm:[email protected].10",
39+
"zone.js": "npm:[email protected].12",
4040
"github:jspm/[email protected]": {
4141
"assert": "npm:[email protected]"
4242
},
@@ -74,16 +74,16 @@ System.config({
7474
"vm-browserify": "npm:[email protected]"
7575
},
7676
"github:twbs/[email protected]": {
77-
"jquery": "github:components/[email protected].1"
77+
"jquery": "npm:[email protected].3"
7878
},
79-
"npm:[email protected].14": {
79+
"npm:[email protected].17": {
8080
"reflect-metadata": "npm:[email protected]",
81-
"rxjs": "npm:[email protected].5",
82-
"zone.js": "npm:[email protected].10"
81+
"rxjs": "npm:[email protected].7",
82+
"zone.js": "npm:[email protected].12"
8383
},
84-
"npm:asn1.js@4.5.2": {
84+
"npm:asn1.js@4.6.0": {
8585
"assert": "github:jspm/[email protected]",
86-
"bn.js": "npm:[email protected].1",
86+
"bn.js": "npm:[email protected].3",
8787
"buffer": "github:jspm/[email protected]",
8888
"fs": "github:jspm/[email protected]",
8989
"inherits": "npm:[email protected]",
@@ -93,7 +93,7 @@ System.config({
9393
9494
"util": "npm:[email protected]"
9595
},
96-
"npm:[email protected].1": {
96+
"npm:[email protected].3": {
9797
"buffer": "github:jspm/[email protected]"
9898
},
9999
@@ -105,7 +105,7 @@ System.config({
105105
"evp_bytestokey": "npm:[email protected]",
106106
"fs": "github:jspm/[email protected]",
107107
"inherits": "npm:[email protected]",
108-
"systemjs-json": "github:systemjs/[email protected].0"
108+
"systemjs-json": "github:systemjs/[email protected].2"
109109
},
110110
111111
"browserify-aes": "npm:[email protected]",
@@ -122,14 +122,14 @@ System.config({
122122
"inherits": "npm:[email protected]"
123123
},
124124
125-
"bn.js": "npm:[email protected].1",
125+
"bn.js": "npm:[email protected].3",
126126
"buffer": "github:jspm/[email protected]",
127127
"constants": "github:jspm/[email protected]",
128128
"crypto": "github:jspm/[email protected]",
129129
"randombytes": "npm:[email protected]"
130130
},
131131
132-
"bn.js": "npm:[email protected].1",
132+
"bn.js": "npm:[email protected].3",
133133
"browserify-rsa": "npm:[email protected]",
134134
"buffer": "github:jspm/[email protected]",
135135
"create-hash": "npm:[email protected]",
@@ -142,7 +142,7 @@ System.config({
142142
},
143143
144144
"buffer": "github:jspm/[email protected]",
145-
"systemjs-json": "github:systemjs/[email protected].0"
145+
"systemjs-json": "github:systemjs/[email protected].2"
146146
},
147147
148148
"base64-js": "npm:[email protected]",
@@ -159,13 +159,13 @@ System.config({
159159
"string_decoder": "github:jspm/[email protected]"
160160
},
161161
162-
"systemjs-json": "github:systemjs/[email protected].0"
162+
"systemjs-json": "github:systemjs/[email protected].2"
163163
},
164164
165165
"buffer": "github:jspm/[email protected]"
166166
},
167167
168-
"bn.js": "npm:[email protected].1",
168+
"bn.js": "npm:[email protected].3",
169169
"buffer": "github:jspm/[email protected]",
170170
"crypto": "github:jspm/[email protected]",
171171
"elliptic": "npm:[email protected]"
@@ -204,19 +204,19 @@ System.config({
204204
"minimalistic-assert": "npm:[email protected]"
205205
},
206206
207-
"bn.js": "npm:[email protected].1",
207+
"bn.js": "npm:[email protected].3",
208208
"buffer": "github:jspm/[email protected]",
209209
"crypto": "github:jspm/[email protected]",
210210
"miller-rabin": "npm:[email protected]",
211211
"randombytes": "npm:[email protected]",
212-
"systemjs-json": "github:systemjs/[email protected].0"
212+
"systemjs-json": "github:systemjs/[email protected].2"
213213
},
214214
215-
"bn.js": "npm:[email protected].1",
215+
"bn.js": "npm:[email protected].3",
216216
"brorand": "npm:[email protected]",
217217
"hash.js": "npm:[email protected]",
218218
"inherits": "npm:[email protected]",
219-
"systemjs-json": "github:systemjs/[email protected].0"
219+
"systemjs-json": "github:systemjs/[email protected].2"
220220
},
221221
222222
"buffer": "github:jspm/[email protected]",
@@ -240,20 +240,20 @@ System.config({
240240
"util": "github:jspm/[email protected]"
241241
},
242242
243-
"bn.js": "npm:[email protected].1",
243+
"bn.js": "npm:[email protected].3",
244244
"brorand": "npm:[email protected]"
245245
},
246246
247247
"os": "github:jspm/[email protected]"
248248
},
249249
250-
"asn1.js": "npm:asn1.js@4.5.2",
250+
"asn1.js": "npm:asn1.js@4.6.0",
251251
"browserify-aes": "npm:[email protected]",
252252
"buffer": "github:jspm/[email protected]",
253253
"create-hash": "npm:[email protected]",
254254
"evp_bytestokey": "npm:[email protected]",
255255
"pbkdf2": "npm:[email protected]",
256-
"systemjs-json": "github:systemjs/[email protected].0"
256+
"systemjs-json": "github:systemjs/[email protected].2"
257257
},
258258
259259
"process": "github:jspm/[email protected]"
@@ -265,13 +265,13 @@ System.config({
265265
"crypto": "github:jspm/[email protected]",
266266
"path": "github:jspm/[email protected]",
267267
"process": "github:jspm/[email protected]",
268-
"systemjs-json": "github:systemjs/[email protected].0"
268+
"systemjs-json": "github:systemjs/[email protected].2"
269269
},
270270
271271
"assert": "github:jspm/[email protected]"
272272
},
273273
274-
"bn.js": "npm:[email protected].1",
274+
"bn.js": "npm:[email protected].3",
275275
"browserify-rsa": "npm:[email protected]",
276276
"buffer": "github:jspm/[email protected]",
277277
"create-hash": "npm:[email protected]",
@@ -294,12 +294,12 @@ System.config({
294294
"stream-browserify": "npm:[email protected]",
295295
"string_decoder": "npm:[email protected]"
296296
},
297-
"npm:[email protected].1": {
297+
"npm:[email protected].2": {
298298
"lodash": "npm:[email protected]",
299299
"lodash-es": "npm:[email protected]",
300300
"loose-envify": "npm:[email protected]",
301301
"process": "github:jspm/[email protected]",
302-
"symbol-observable": "npm:[email protected].2"
302+
"symbol-observable": "npm:[email protected].4"
303303
},
304304
305305
"assert": "github:jspm/[email protected]",
@@ -313,13 +313,10 @@ System.config({
313313
"buffer": "github:jspm/[email protected]",
314314
"process": "github:jspm/[email protected]"
315315
},
316-
"npm:[email protected].5": {
316+
"npm:[email protected].7": {
317317
"buffer": "github:jspm/[email protected]",
318-
"process": "github:jspm/[email protected]"
319-
},
320-
321-
"buffer": "github:jspm/[email protected]",
322-
"process": "github:jspm/[email protected]"
318+
"process": "github:jspm/[email protected]",
319+
"symbol-observable": "npm:[email protected]"
323320
},
324321
325322
"buffer": "github:jspm/[email protected]",
@@ -335,7 +332,7 @@ System.config({
335332
336333
"buffer": "github:jspm/[email protected]"
337334
},
338-
"npm:[email protected].9": {
335+
"npm:[email protected].10": {
339336
"os": "github:jspm/[email protected]"
340337
},
341338
@@ -345,7 +342,8 @@ System.config({
345342
346343
"indexof": "npm:[email protected]"
347344
},
348-
345+
346+
"buffer": "github:jspm/[email protected]",
349347
"process": "github:jspm/[email protected]"
350348
}
351349
}

package.json

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,13 @@
3232
},
3333
"homepage": "https://github.com/InfomediaLtd/angular2-redux#readme",
3434
"peerDependencies": {
35-
"redux": "^3.5.1",
36-
"redux-thunk": "^2.0.1"
35+
"redux": "^3.5.2",
36+
"redux-thunk": "^2.0.1",
37+
"rxjs": "^5.0.0-beta.6"
3738
},
3839
"dependencies": {},
3940
"devDependencies": {
40-
"angular2": "^2.0.0-beta.14",
41+
"angular2": "^2.0.0-beta.17",
4142
"commitizen": "^2.4.6",
4243
"cz-conventional-changelog": "^1.1.5",
4344
"es6-promise": "^3.1.2",
@@ -57,18 +58,18 @@
5758
"karma-phantomjs-launcher": "^0.2.3",
5859
"phantomjs": "^1.9.19",
5960
"phantomjs-polyfill": "0.0.1",
60-
"redux": "^3.5.1",
61+
"redux": "^3.5.2",
6162
"redux-thunk": "^2.0.1",
6263
"reflect-metadata": "0.1.2",
6364
"rimraf": "^2.4.4",
6465
"run-sequence": "^1.1.5",
65-
"rxjs": "5.0.0-beta.2",
66+
"rxjs": "5.0.0-beta.6",
6667
"semantic-release": "^4.3.5",
6768
"tsc": "^1.20150623.0",
6869
"tslint": "^3.2.1",
6970
"tslint-stylish": "^2.1.0-beta",
7071
"typescript": "^1.8",
71-
"zone.js": "^0.6.10"
72+
"zone.js": "^0.6.12"
7273
},
7374
"config": {
7475
"commitizen": {
@@ -81,18 +82,18 @@
8182
"jspmNodeConversion": false,
8283
"jspm": {
8384
"dependencies": {
84-
"angular2": "npm:angular2@^2.0.0-beta.14",
85-
"crypto": "github:jspm/nodelibs-crypto@^0.1.0",
86-
"redux": "npm:[email protected]",
85+
"redux": "npm:redux@^3.5.2",
8786
"redux-thunk": "npm:redux-thunk@^2.0.1",
88-
"reflect-metadata": "npm:reflect-metadata@^0.1.3",
89-
"rxjs": "npm:rxjs@^5.0.0-beta.6",
90-
"zone.js": "npm:zone.js@^0.6.10"
87+
"rxjs": "npm:rxjs@^5.0.0-beta.7"
9188
},
9289
"devDependencies": {
90+
"angular2": "npm:angular2@^2.0.0-beta.17",
9391
"bootstrap": "github:twbs/bootstrap@^3.3.6",
92+
"crypto": "github:jspm/nodelibs-crypto@^0.1.0",
9493
"css": "github:systemjs/plugin-css@^0.1.20",
95-
"typescript": "npm:typescript@^1.8"
94+
"reflect-metadata": "npm:reflect-metadata@^0.1.3",
95+
"typescript": "npm:typescript@^1.8",
96+
"zone.js": "npm:zone.js@^0.6.10"
9697
}
9798
}
9899
}

src/app-store.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export class AppStore {
1717
/**
1818
* subscribe to a callback with the state
1919
*/
20-
public subscribe:(subscribeFunction:(state)=>void)=>()=>void;
20+
public subscribe:(subscriber:(state)=>void)=>()=>void;
2121
/**
2222
* Dispatch an action
2323
*/
@@ -27,13 +27,14 @@ export class AppStore {
2727
*/
2828
public createDispatcher:(actionCreator, context)=>(...n:any[])=>void;
2929

30-
private _value:Observable<any>;
30+
public store$:Observable<any>;
3131

3232
constructor(store:any) {
33+
this.store$ = Observable.from(store);
3334
this.getState = () => {
3435
return store.getState();
3536
};
36-
this.subscribe = (subscriber:(state)=>any) => {
37+
this.subscribe = (subscriber:(state)=>void) => {
3738
// decorate the subscriber with the state passed in as a parameter
3839
return store.subscribe(() => subscriber(store.getState()));
3940
};
@@ -43,15 +44,14 @@ export class AppStore {
4344
this.createDispatcher = (actionCreator, context):(...n:any[])=>void => {
4445
return (...args) => store.dispatch(actionCreator.call(context, ...args));
4546
};
46-
this._value = Observable.from(store);
4747
}
4848

4949
public select<R>(keyOrSelector: ((state: any) => R) | string | number | symbol): Observable<R> {
5050
if (typeof keyOrSelector === "string" || typeof keyOrSelector === "number"
5151
|| typeof keyOrSelector === "symbol") {
52-
return this._value.map(state => state[<string|number|symbol> keyOrSelector]).distinctUntilChanged();
52+
return this.store$.map(state => state[<string|number|symbol> keyOrSelector]).distinctUntilChanged();
5353
} else if (typeof keyOrSelector === "function") {
54-
return this._value.map(keyOrSelector).distinctUntilChanged();
54+
return this.store$.map(keyOrSelector).distinctUntilChanged();
5555
} else {
5656
throw new TypeError(`Unknown Parameter Type: `
5757
+ `Expected type of function or valid key type, got ${typeof keyOrSelector}`);

0 commit comments

Comments
 (0)