Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(rxjs) update rxjs to be a peerDependency (v6 or v7) #120

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 43 additions & 33 deletions dist/amd/aurelia-store.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,29 +13,31 @@ define('aurelia-store', ['exports', 'rxjs', 'aurelia-dependency-injection', 'aur
}

/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
Copyright (c) Microsoft Corporation.

THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.

See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
/* global Reflect, Promise */

var extendStatics = function(d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};

function __extends(d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
Expand All @@ -53,10 +55,11 @@ define('aurelia-store', ['exports', 'rxjs', 'aurelia-dependency-injection', 'aur
};

function __awaiter(thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
}
Expand Down Expand Up @@ -87,6 +90,12 @@ define('aurelia-store', ['exports', 'rxjs', 'aurelia-dependency-injection', 'aur
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
}
}

function __spreadArray(to, from) {
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
to[j] = from[i];
return to;
}

function jump(state, n) {
Expand All @@ -104,7 +113,7 @@ define('aurelia-store', ['exports', 'rxjs', 'aurelia-dependency-injection', 'aur
return state;
}
var past = state.past, future = state.future, present = state.present;
var newPast = past.concat([present], future.slice(0, index));
var newPast = __spreadArray(__spreadArray(__spreadArray([], past), [present]), future.slice(0, index));
var newPresent = future[index];
var newFuture = future.slice(index + 1);
return { past: newPast, present: newPresent, future: newFuture };
Expand All @@ -115,13 +124,13 @@ define('aurelia-store', ['exports', 'rxjs', 'aurelia-dependency-injection', 'aur
}
var past = state.past, future = state.future, present = state.present;
var newPast = past.slice(0, index);
var newFuture = past.slice(index + 1).concat([present], future);
var newFuture = __spreadArray(__spreadArray(__spreadArray([], past.slice(index + 1)), [present]), future);
var newPresent = past[index];
return { past: newPast, present: newPresent, future: newFuture };
}
function nextStateHistory(presentStateHistory, nextPresent) {
return Object.assign({}, presentStateHistory, {
past: presentStateHistory.past.concat([presentStateHistory.present]),
past: __spreadArray(__spreadArray([], presentStateHistory.past), [presentStateHistory.present]),
present: nextPresent,
future: []
});
Expand All @@ -146,6 +155,7 @@ define('aurelia-store', ['exports', 'rxjs', 'aurelia-dependency-injection', 'aur
}

var DEFAULT_LOCAL_STORAGE_KEY = "aurelia-store-state";
exports.MiddlewarePlacement = void 0;
(function (MiddlewarePlacement) {
MiddlewarePlacement["Before"] = "before";
MiddlewarePlacement["After"] = "after";
Expand Down Expand Up @@ -175,6 +185,7 @@ define('aurelia-store', ['exports', 'rxjs', 'aurelia-dependency-injection', 'aur
return state;
}

exports.LogLevel = void 0;
(function (LogLevel) {
LogLevel["trace"] = "trace";
LogLevel["debug"] = "debug";
Expand All @@ -201,6 +212,7 @@ define('aurelia-store', ['exports', 'rxjs', 'aurelia-dependency-injection', 'aur
return defaultLevel;
}

exports.PerformanceMeasurement = void 0;
(function (PerformanceMeasurement) {
PerformanceMeasurement["StartEnd"] = "startEnd";
PerformanceMeasurement["All"] = "all";
Expand Down Expand Up @@ -300,12 +312,12 @@ define('aurelia-store', ['exports', 'rxjs', 'aurelia-dependency-injection', 'aur
return dispatchPipe;
}
};
return dispatchPipe.pipe.apply(dispatchPipe, [reducer].concat(params));
return dispatchPipe.pipe.apply(dispatchPipe, __spreadArray([reducer], params));
};
Store.prototype.lookupAction = function (reducer) {
if (typeof reducer === "string") {
var result = Array.from(this.actions).find(function (_a) {
var _ = _a[0], action = _a[1];
_a[0]; var action = _a[1];
return action.type === reducer;
});
if (result) {
Expand Down Expand Up @@ -397,7 +409,7 @@ define('aurelia-store', ['exports', 'rxjs', 'aurelia-dependency-injection', 'aur
case 2:
if (!(_i < pipedActions_1.length)) return [3 /*break*/, 5];
action = pipedActions_1[_i];
return [4 /*yield*/, action.reducer.apply(action, [result].concat(action.params))];
return [4 /*yield*/, action.reducer.apply(action, __spreadArray([result], action.params))];
case 3:
result = _a.sent();
if (result === false) {
Expand Down Expand Up @@ -462,7 +474,6 @@ define('aurelia-store', ['exports', 'rxjs', 'aurelia-dependency-injection', 'aur
case 2:
result = _d.sent();
if (result === false) {
_arr = [];
return [2 /*return*/, false];
}
_c = result;
Expand All @@ -475,7 +486,6 @@ define('aurelia-store', ['exports', 'rxjs', 'aurelia-dependency-injection', 'aur
case 5:
e_2 = _d.sent();
if (this.options.propagateError) {
_arr = [];
throw e_2;
}
return [4 /*yield*/, prev];
Expand Down Expand Up @@ -509,7 +519,7 @@ define('aurelia-store', ['exports', 'rxjs', 'aurelia-dependency-injection', 'aur
if (!message.payload.args || message.payload.args.length < 1) {
throw new Error("No action arguments provided");
}
_this.dispatch.apply(_this, [action].concat(message.payload.args.slice(1).map(function (arg) { return JSON.parse(arg); })));
_this.dispatch.apply(_this, __spreadArray([action], message.payload.args.slice(1).map(function (arg) { return JSON.parse(arg); })));
return;
}
if (message.type === "DISPATCH" && message.payload) {
Expand Down Expand Up @@ -572,7 +582,7 @@ define('aurelia-store', ['exports', 'rxjs', 'aurelia-dependency-injection', 'aur
for (var _i = 0; _i < arguments.length; _i++) {
params[_i] = arguments[_i];
}
return store.dispatch.apply(store, [action].concat(params));
return store.dispatch.apply(store, __spreadArray([action], params));
};
}

Expand Down Expand Up @@ -645,8 +655,8 @@ define('aurelia-store', ['exports', 'rxjs', 'aurelia-dependency-injection', 'aur
_a[_settings.target || "state"] = _settings.selector || defaultSelector,
_a);
return Object.entries(__assign({}, (isSelectorObj ? _settings.selector : fallbackSelector))).map(function (_a) {
var target = _a[0], selector = _a[1];
var _b;
var target = _a[0], selector = _a[1];
return ({
targets: _settings.target && isSelectorObj ? [_settings.target, target] : [target],
selector: selector,
Expand Down Expand Up @@ -737,22 +747,22 @@ define('aurelia-store', ['exports', 'rxjs', 'aurelia-dependency-injection', 'aur
.registerInstance(Store, new Store(initState, options));
}

exports.configure = configure;
exports.UnregisteredActionError = UnregisteredActionError;
exports.DEFAULT_LOCAL_STORAGE_KEY = DEFAULT_LOCAL_STORAGE_KEY;
exports.LoggerIndexed = LoggerIndexed;
exports.Store = Store;
exports.UnregisteredActionError = UnregisteredActionError;
exports.applyLimits = applyLimits;
exports.configure = configure;
exports.connectTo = connectTo;
exports.dispatchify = dispatchify;
exports.executeSteps = executeSteps;
exports.jump = jump;
exports.nextStateHistory = nextStateHistory;
exports.applyLimits = applyLimits;
exports.getLogType = getLogType;
exports.isStateHistory = isStateHistory;
exports.DEFAULT_LOCAL_STORAGE_KEY = DEFAULT_LOCAL_STORAGE_KEY;
exports.logMiddleware = logMiddleware;
exports.jump = jump;
exports.localStorageMiddleware = localStorageMiddleware;
exports.logMiddleware = logMiddleware;
exports.nextStateHistory = nextStateHistory;
exports.rehydrateFromLocalStorage = rehydrateFromLocalStorage;
exports.LoggerIndexed = LoggerIndexed;
exports.getLogType = getLogType;
exports.connectTo = connectTo;

Object.defineProperty(exports, '__esModule', { value: true });

Expand Down
8 changes: 6 additions & 2 deletions dist/aurelia-store.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Generated by dts-bundle-generator v5.9.0

import { Container } from 'aurelia-dependency-injection';
import { Logger } from 'aurelia-logging';
import { Observable } from 'rxjs';
Expand Down Expand Up @@ -281,7 +283,7 @@ export declare class Store<T> {
}
export declare function dispatchify<T, P extends any[]>(action: Reducer<T, P> | string): (...params: P) => Promise<void>;
export declare type StepFn<T> = (res: T) => void;
export declare function executeSteps<T>(store: Store<T>, shouldLogResults: boolean, ...steps: StepFn<T>[]): Promise<{}>;
export declare function executeSteps<T>(store: Store<T>, shouldLogResults: boolean, ...steps: StepFn<T>[]): Promise<void>;
export interface ConnectToSettings<T, R = T | any> {
onChanged?: string;
selector: ((store: Store<T>) => Observable<R>) | MultipleSelector<T, R>;
Expand All @@ -299,4 +301,6 @@ export interface FrameworkConfiguration {
export interface StorePluginOptions<T> extends StoreOptions {
initialState: T;
}
export declare function configure<T>(aurelia: FrameworkConfiguration, options: Partial<StorePluginOptions<T>>): void;
export declare function configure<T>(aurelia: FrameworkConfiguration, options: Partial<StorePluginOptions<T>>): void;

export {};
Loading