Skip to content

Commit

Permalink
chore(all): prepare release 1.3.3
Browse files Browse the repository at this point in the history
  • Loading branch information
EisenbergEffect committed Feb 14, 2019
1 parent 89c12dd commit ddc3680
Show file tree
Hide file tree
Showing 9 changed files with 142 additions and 8 deletions.
23 changes: 22 additions & 1 deletion dist/amd/aurelia-store.js
Original file line number Diff line number Diff line change
Expand Up @@ -505,9 +505,16 @@ define('aurelia-store', ['exports', 'rxjs', 'aurelia-dependency-injection', 'aur
if (!Object.entries) {
throw new Error("You need a polyfill for Object.entries for browsers like Internet Explorer. Example: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/entries#Polyfill");
}
var store = aureliaDependencyInjection.Container.instance.get(Store);
var $store;
// const store = Container.instance.get(Store) as Store<T>;
var _settings = __assign({ selector: typeof settings === "function" ? settings : defaultSelector }, settings);
function getSource(selector) {
// if for some reason getSource is invoked before setup (bind lifecycle, typically)
// then we have no choice but to get the store instance from global container instance
// otherwise, assume that $store variable in the closure would be already assigned the right
// value from created callback
// Could also be in situation where it doesn't come from custom element, or some exotic setups/scenarios
var store = $store || ($store = aureliaDependencyInjection.Container.instance.get(Store));
var source = selector(store);
if (source instanceof rxjs.Observable) {
return source;
Expand Down Expand Up @@ -537,12 +544,26 @@ define('aurelia-store', ['exports', 'rxjs', 'aurelia-dependency-injection', 'aur
});
}
return function (target) {
var originalCreated = target.prototype.created;
var originalSetup = typeof settings === "object" && settings.setup
? target.prototype[settings.setup]
: target.prototype.bind;
var originalTeardown = typeof settings === "object" && settings.teardown
? target.prototype[settings.teardown]
: target.prototype.unbind;
// only override if prototype callback is a function
if (typeof originalCreated === "function" || originalCreated === undefined) {
target.prototype.created = function created(_, view) {
// here we relies on the fact that the class Store
// has not been registered somewhere in one of child containers, instead of root container
// if there is any issue with this approach, needs to walk all the way up to resolve from root
// typically like invoking from global Container.instance
$store = view.container.get(Store);
if (originalCreated !== undefined) {
return originalCreated.call(this, _, view);
}
};
}
target.prototype[typeof settings === "object" && settings.setup ? settings.setup : "bind"] = function () {
var _this = this;
if (typeof settings == "object" &&
Expand Down
5 changes: 4 additions & 1 deletion dist/aurelia-store.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { FrameworkConfiguration } from 'aurelia-framework';
import { Container } from 'aurelia-dependency-injection';
import { Logger } from 'aurelia-logging';
import { Observable } from 'rxjs';

Expand Down Expand Up @@ -267,6 +267,9 @@ export interface MultipleSelector<T, R = T | any> {
[key: string]: ((store: Store<T>) => Observable<R>);
}
export declare function connectTo<T, R = any>(settings?: ((store: Store<T>) => Observable<R>) | ConnectToSettings<T, R>): (target: any) => void;
export interface FrameworkConfiguration {
container: Container;
}
export interface StorePluginOptions<T> extends StoreOptions {
initialState: T;
}
Expand Down
23 changes: 22 additions & 1 deletion dist/commonjs/aurelia-store.js
Original file line number Diff line number Diff line change
Expand Up @@ -513,9 +513,16 @@ function connectTo(settings) {
if (!Object.entries) {
throw new Error("You need a polyfill for Object.entries for browsers like Internet Explorer. Example: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/entries#Polyfill");
}
var store = aureliaDependencyInjection.Container.instance.get(Store);
var $store;
// const store = Container.instance.get(Store) as Store<T>;
var _settings = __assign({ selector: typeof settings === "function" ? settings : defaultSelector }, settings);
function getSource(selector) {
// if for some reason getSource is invoked before setup (bind lifecycle, typically)
// then we have no choice but to get the store instance from global container instance
// otherwise, assume that $store variable in the closure would be already assigned the right
// value from created callback
// Could also be in situation where it doesn't come from custom element, or some exotic setups/scenarios
var store = $store || ($store = aureliaDependencyInjection.Container.instance.get(Store));
var source = selector(store);
if (source instanceof rxjs.Observable) {
return source;
Expand Down Expand Up @@ -545,12 +552,26 @@ function connectTo(settings) {
});
}
return function (target) {
var originalCreated = target.prototype.created;
var originalSetup = typeof settings === "object" && settings.setup
? target.prototype[settings.setup]
: target.prototype.bind;
var originalTeardown = typeof settings === "object" && settings.teardown
? target.prototype[settings.teardown]
: target.prototype.unbind;
// only override if prototype callback is a function
if (typeof originalCreated === "function" || originalCreated === undefined) {
target.prototype.created = function created(_, view) {
// here we relies on the fact that the class Store
// has not been registered somewhere in one of child containers, instead of root container
// if there is any issue with this approach, needs to walk all the way up to resolve from root
// typically like invoking from global Container.instance
$store = view.container.get(Store);
if (originalCreated !== undefined) {
return originalCreated.call(this, _, view);
}
};
}
target.prototype[typeof settings === "object" && settings.setup ? settings.setup : "bind"] = function () {
var _this = this;
if (typeof settings == "object" &&
Expand Down
23 changes: 22 additions & 1 deletion dist/es2015/aurelia-store.js
Original file line number Diff line number Diff line change
Expand Up @@ -385,9 +385,16 @@ function connectTo(settings) {
if (!Object.entries) {
throw new Error("You need a polyfill for Object.entries for browsers like Internet Explorer. Example: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/entries#Polyfill");
}
const store = Container.instance.get(Store);
let $store;
// const store = Container.instance.get(Store) as Store<T>;
const _settings = Object.assign({ selector: typeof settings === "function" ? settings : defaultSelector }, settings);
function getSource(selector) {
// if for some reason getSource is invoked before setup (bind lifecycle, typically)
// then we have no choice but to get the store instance from global container instance
// otherwise, assume that $store variable in the closure would be already assigned the right
// value from created callback
// Could also be in situation where it doesn't come from custom element, or some exotic setups/scenarios
const store = $store || ($store = Container.instance.get(Store));
const source = selector(store);
if (source instanceof Observable) {
return source;
Expand All @@ -412,12 +419,26 @@ function connectTo(settings) {
}));
}
return function (target) {
const originalCreated = target.prototype.created;
const originalSetup = typeof settings === "object" && settings.setup
? target.prototype[settings.setup]
: target.prototype.bind;
const originalTeardown = typeof settings === "object" && settings.teardown
? target.prototype[settings.teardown]
: target.prototype.unbind;
// only override if prototype callback is a function
if (typeof originalCreated === "function" || originalCreated === undefined) {
target.prototype.created = function created(_, view) {
// here we relies on the fact that the class Store
// has not been registered somewhere in one of child containers, instead of root container
// if there is any issue with this approach, needs to walk all the way up to resolve from root
// typically like invoking from global Container.instance
$store = view.container.get(Store);
if (originalCreated !== undefined) {
return originalCreated.call(this, _, view);
}
};
}
target.prototype[typeof settings === "object" && settings.setup ? settings.setup : "bind"] = function () {
if (typeof settings == "object" &&
typeof settings.onChanged === "string" &&
Expand Down
23 changes: 22 additions & 1 deletion dist/es2017/aurelia-store.js
Original file line number Diff line number Diff line change
Expand Up @@ -355,9 +355,16 @@ function connectTo(settings) {
if (!Object.entries) {
throw new Error("You need a polyfill for Object.entries for browsers like Internet Explorer. Example: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/entries#Polyfill");
}
const store = Container.instance.get(Store);
let $store;
// const store = Container.instance.get(Store) as Store<T>;
const _settings = Object.assign({ selector: typeof settings === "function" ? settings : defaultSelector }, settings);
function getSource(selector) {
// if for some reason getSource is invoked before setup (bind lifecycle, typically)
// then we have no choice but to get the store instance from global container instance
// otherwise, assume that $store variable in the closure would be already assigned the right
// value from created callback
// Could also be in situation where it doesn't come from custom element, or some exotic setups/scenarios
const store = $store || ($store = Container.instance.get(Store));
const source = selector(store);
if (source instanceof Observable) {
return source;
Expand All @@ -382,12 +389,26 @@ function connectTo(settings) {
}));
}
return function (target) {
const originalCreated = target.prototype.created;
const originalSetup = typeof settings === "object" && settings.setup
? target.prototype[settings.setup]
: target.prototype.bind;
const originalTeardown = typeof settings === "object" && settings.teardown
? target.prototype[settings.teardown]
: target.prototype.unbind;
// only override if prototype callback is a function
if (typeof originalCreated === "function" || originalCreated === undefined) {
target.prototype.created = function created(_, view) {
// here we relies on the fact that the class Store
// has not been registered somewhere in one of child containers, instead of root container
// if there is any issue with this approach, needs to walk all the way up to resolve from root
// typically like invoking from global Container.instance
$store = view.container.get(Store);
if (originalCreated !== undefined) {
return originalCreated.call(this, _, view);
}
};
}
target.prototype[typeof settings === "object" && settings.setup ? settings.setup : "bind"] = function () {
if (typeof settings == "object" &&
typeof settings.onChanged === "string" &&
Expand Down
23 changes: 22 additions & 1 deletion dist/native-modules/aurelia-store.js
Original file line number Diff line number Diff line change
Expand Up @@ -512,9 +512,16 @@ function connectTo(settings) {
if (!Object.entries) {
throw new Error("You need a polyfill for Object.entries for browsers like Internet Explorer. Example: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/entries#Polyfill");
}
var store = Container.instance.get(Store);
var $store;
// const store = Container.instance.get(Store) as Store<T>;
var _settings = __assign({ selector: typeof settings === "function" ? settings : defaultSelector }, settings);
function getSource(selector) {
// if for some reason getSource is invoked before setup (bind lifecycle, typically)
// then we have no choice but to get the store instance from global container instance
// otherwise, assume that $store variable in the closure would be already assigned the right
// value from created callback
// Could also be in situation where it doesn't come from custom element, or some exotic setups/scenarios
var store = $store || ($store = Container.instance.get(Store));
var source = selector(store);
if (source instanceof Observable) {
return source;
Expand Down Expand Up @@ -544,12 +551,26 @@ function connectTo(settings) {
});
}
return function (target) {
var originalCreated = target.prototype.created;
var originalSetup = typeof settings === "object" && settings.setup
? target.prototype[settings.setup]
: target.prototype.bind;
var originalTeardown = typeof settings === "object" && settings.teardown
? target.prototype[settings.teardown]
: target.prototype.unbind;
// only override if prototype callback is a function
if (typeof originalCreated === "function" || originalCreated === undefined) {
target.prototype.created = function created(_, view) {
// here we relies on the fact that the class Store
// has not been registered somewhere in one of child containers, instead of root container
// if there is any issue with this approach, needs to walk all the way up to resolve from root
// typically like invoking from global Container.instance
$store = view.container.get(Store);
if (originalCreated !== undefined) {
return originalCreated.call(this, _, view);
}
};
}
target.prototype[typeof settings === "object" && settings.setup ? settings.setup : "bind"] = function () {
var _this = this;
if (typeof settings == "object" &&
Expand Down
23 changes: 22 additions & 1 deletion dist/umd/aurelia-store.js
Original file line number Diff line number Diff line change
Expand Up @@ -382,9 +382,16 @@
if (!Object.entries) {
throw new Error("You need a polyfill for Object.entries for browsers like Internet Explorer. Example: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/entries#Polyfill");
}
const store = aureliaDependencyInjection.Container.instance.get(Store);
let $store;
// const store = Container.instance.get(Store) as Store<T>;
const _settings = Object.assign({ selector: typeof settings === "function" ? settings : defaultSelector }, settings);
function getSource(selector) {
// if for some reason getSource is invoked before setup (bind lifecycle, typically)
// then we have no choice but to get the store instance from global container instance
// otherwise, assume that $store variable in the closure would be already assigned the right
// value from created callback
// Could also be in situation where it doesn't come from custom element, or some exotic setups/scenarios
const store = $store || ($store = aureliaDependencyInjection.Container.instance.get(Store));
const source = selector(store);
if (source instanceof rxjs.Observable) {
return source;
Expand All @@ -409,12 +416,26 @@
}));
}
return function (target) {
const originalCreated = target.prototype.created;
const originalSetup = typeof settings === "object" && settings.setup
? target.prototype[settings.setup]
: target.prototype.bind;
const originalTeardown = typeof settings === "object" && settings.teardown
? target.prototype[settings.teardown]
: target.prototype.unbind;
// only override if prototype callback is a function
if (typeof originalCreated === "function" || originalCreated === undefined) {
target.prototype.created = function created(_, view) {
// here we relies on the fact that the class Store
// has not been registered somewhere in one of child containers, instead of root container
// if there is any issue with this approach, needs to walk all the way up to resolve from root
// typically like invoking from global Container.instance
$store = view.container.get(Store);
if (originalCreated !== undefined) {
return originalCreated.call(this, _, view);
}
};
}
target.prototype[typeof settings === "object" && settings.setup ? settings.setup : "bind"] = function () {
if (typeof settings == "object" &&
typeof settings.onChanged === "string" &&
Expand Down
5 changes: 5 additions & 0 deletions doc/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
<a name="1.3.3"></a>
## [1.3.3](https://github.com/aurelia/store/compare/1.3.2...1.3.3) (2019-02-14)



<a name="1.3.2"></a>
## [1.3.2](https://github.com/aurelia/store/compare/1.3.1...1.3.2) (2019-01-19)

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "aurelia-store",
"version": "1.3.2",
"version": "1.3.3",
"description": "Aurelia single state store based on RxJS",
"keywords": [
"aurelia",
Expand Down

0 comments on commit ddc3680

Please sign in to comment.