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

fix code style #10

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
45 changes: 29 additions & 16 deletions src/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,22 +35,24 @@ export class Store<S extends object> {
P1 extends keyof Object.Path<S, []>,
P2 extends keyof Object.Path<S, [P1]>,
P3 extends keyof Object.Path<S, [P1, P2]>
>(value: Object.Path<S, [P1, P2, P3]>, part1: P1, part2: P2, part3: P3): void
>(value: Object.Path<S, [P1, P2, P3]>, part1: P1, part2: P2, part3: P3): void;
// prettier-ignore
patchState<
P1 extends keyof Object.Path<S, []>,
P2 extends keyof Object.Path<S, [P1]>,
P3 extends keyof Object.Path<S, [P1, P2]>,
P4 extends keyof Object.Path<S, [P1, P2, P3]>
>(value: Object.Path<S, [P1, P2, P3, P4]>, part1: P1, part2: P2, part3: P3, part4: P4): void
// tslint:disable-next-line:max-line-length
>(value: Object.Path<S, [P1, P2, P3, P4]>, part1: P1, part2: P2, part3: P3, part4: P4): void;
// prettier-ignore
patchState<
P1 extends keyof Object.Path<S, []>,
P2 extends keyof Object.Path<S, [P1]>,
P3 extends keyof Object.Path<S, [P1, P2]>,
P4 extends keyof Object.Path<S, [P1, P2, P3]>,
P5 extends keyof Object.Path<S, [P1, P2, P3, P4]>
>(value: Object.Path<S, [P1, P2, P3, P4, P5]>, part1: P1, part2: P2, part3: P3, part4: P4, part5: P5): void
// tslint:disable-next-line:max-line-length
>(value: Object.Path<S, [P1, P2, P3, P4, P5]>, part1: P1, part2: P2, part3: P3, part4: P4, part5: P5): void;
// prettier-ignore
patchState<
P1 extends keyof Object.Path<S, []>,
Expand All @@ -59,7 +61,8 @@ export class Store<S extends object> {
P4 extends keyof Object.Path<S, [P1, P2, P3]>,
P5 extends keyof Object.Path<S, [P1, P2, P3, P4]>,
P6 extends keyof Object.Path<S, [P1, P2, P3, P4, P5]>
>(value: Object.Path<S, [P1, P2, P3, P4, P5, P6]>, part1: P1, part2: P2, part3: P3, part4: P4, part5: P5, part6: P6): void
// tslint:disable-next-line:max-line-length
>(value: Object.Path<S, [P1, P2, P3, P4, P5, P6]>, part1: P1, part2: P2, part3: P3, part4: P4, part5: P5, part6: P6): void;
// prettier-ignore
patchState<
P1 extends keyof Object.Path<S, []>,
Expand All @@ -69,7 +72,8 @@ export class Store<S extends object> {
P5 extends keyof Object.Path<S, [P1, P2, P3, P4]>,
P6 extends keyof Object.Path<S, [P1, P2, P3, P4, P5]>,
P7 extends keyof Object.Path<S, [P1, P2, P3, P4, P5, P6]>
>(value: Object.Path<S, [P1, P2, P3, P4, P5, P6, P7]>, part1: P1, part2: P2, part3: P3, part4: P4, part5: P5, part6: P6, part7: P7): void
// tslint:disable-next-line:max-line-length
>(value: Object.Path<S, [P1, P2, P3, P4, P5, P6, P7]>, part1: P1, part2: P2, part3: P3, part4: P4, part5: P5, part6: P6, part7: P7): void;
// prettier-ignore
patchState<
P1 extends keyof Object.Path<S, []>,
Expand All @@ -80,7 +84,8 @@ export class Store<S extends object> {
P6 extends keyof Object.Path<S, [P1, P2, P3, P4, P5]>,
P7 extends keyof Object.Path<S, [P1, P2, P3, P4, P5, P6]>,
P8 extends keyof Object.Path<S, [P1, P2, P3, P4, P5, P6, P7]>
>(value: Object.Path<S, [P1, P2, P3, P4, P5, P6, P7, P8]>, part1: P1, part2: P2, part3: P3, part4: P4, part5: P5, part6: P6, part7: P7, part8: P8): void
// tslint:disable-next-line:max-line-length
>(value: Object.Path<S, [P1, P2, P3, P4, P5, P6, P7, P8]>, part1: P1, part2: P2, part3: P3, part4: P4, part5: P5, part6: P6, part7: P7, part8: P8): void;
// prettier-ignore
patchState<
P1 extends keyof Object.Path<S, []>,
Expand All @@ -92,7 +97,8 @@ export class Store<S extends object> {
P7 extends keyof Object.Path<S, [P1, P2, P3, P4, P5, P6]>,
P8 extends keyof Object.Path<S, [P1, P2, P3, P4, P5, P6, P7]>,
P9 extends keyof Object.Path<S, [P1, P2, P3, P4, P5, P6, P7, P8]>
>(value: Object.Path<S, [P1, P2, P3, P4, P5, P6, P7, P8, P9]>, part1: P1, part2: P2, part3: P3, part4: P4, part5: P5, part6: P6, part7: P7, part8: P8, part9: P9): void
// tslint:disable-next-line:max-line-length
>(value: Object.Path<S, [P1, P2, P3, P4, P5, P6, P7, P8, P9]>, part1: P1, part2: P2, part3: P3, part4: P4, part5: P5, part6: P6, part7: P7, part8: P8, part9: P9): void;
// prettier-ignore
patchState<
P1 extends keyof Object.Path<S, []>,
Expand All @@ -105,7 +111,8 @@ export class Store<S extends object> {
P8 extends keyof Object.Path<S, [P1, P2, P3, P4, P5, P6, P7]>,
P9 extends keyof Object.Path<S, [P1, P2, P3, P4, P5, P6, P7, P8]>,
R extends Index[]
>(value: Object.Path<S, Tuple.Concat<[P1, P2, P3, P4, P5, P6, P7, P8, P9], R>>, part1: P1, part2: P2, part3: P3, part4: P4, part5: P5, part6: P6, part7: P7, part8: P8, part9: P9, ...rest: R): void
// tslint:disable-next-line:max-line-length
>(value: Object.Path<S, Tuple.Concat<[P1, P2, P3, P4, P5, P6, P7, P8, P9], R>>, part1: P1, part2: P2, part3: P3, part4: P4, part5: P5, part6: P6, part7: P7, part8: P8, part9: P9, ...rest: R): void;

patchState(value: any, ...path: Index[]) {
if (path.length < 1) {
Expand All @@ -126,22 +133,23 @@ export class Store<S extends object> {
P1 extends keyof Object.Path<S, []>,
P2 extends keyof Object.Path<S, [P1]>,
P3 extends keyof Object.Path<S, [P1, P2]>
>(part1: P1, part2: P2, part3: P3): Observable<Object.Path<S, [P1, P2, P3]>>
>(part1: P1, part2: P2, part3: P3): Observable<Object.Path<S, [P1, P2, P3]>>;
// prettier-ignore
onChanges<
P1 extends keyof Object.Path<S, []>,
P2 extends keyof Object.Path<S, [P1]>,
P3 extends keyof Object.Path<S, [P1, P2]>,
P4 extends keyof Object.Path<S, [P1, P2, P3]>
>(part1: P1, part2: P2, part3: P3, part4: P4): Observable<Object.Path<S, [P1, P2, P3, P4]>>
>(part1: P1, part2: P2, part3: P3, part4: P4): Observable<Object.Path<S, [P1, P2, P3, P4]>>;
// prettier-ignore
onChanges<
P1 extends keyof Object.Path<S, []>,
P2 extends keyof Object.Path<S, [P1]>,
P3 extends keyof Object.Path<S, [P1, P2]>,
P4 extends keyof Object.Path<S, [P1, P2, P3]>,
P5 extends keyof Object.Path<S, [P1, P2, P3, P4]>
>(part1: P1, part2: P2, part3: P3, part4: P4, part5: P5): Observable<Object.Path<S, [P1, P2, P3, P4, P5]>>
// tslint:disable-next-line:max-line-length
>(part1: P1, part2: P2, part3: P3, part4: P4, part5: P5): Observable<Object.Path<S, [P1, P2, P3, P4, P5]>>;
// prettier-ignore
onChanges<
P1 extends keyof Object.Path<S, []>,
Expand All @@ -150,7 +158,8 @@ export class Store<S extends object> {
P4 extends keyof Object.Path<S, [P1, P2, P3]>,
P5 extends keyof Object.Path<S, [P1, P2, P3, P4]>,
P6 extends keyof Object.Path<S, [P1, P2, P3, P4, P5]>
>(part1: P1, part2: P2, part3: P3, part4: P4, part5: P5, part6: P6): Observable<Object.Path<S, [P1, P2, P3, P4, P5, P6]>>
// tslint:disable-next-line:max-line-length
>(part1: P1, part2: P2, part3: P3, part4: P4, part5: P5, part6: P6): Observable<Object.Path<S, [P1, P2, P3, P4, P5, P6]>>;
// prettier-ignore
onChanges<
P1 extends keyof Object.Path<S, []>,
Expand All @@ -160,7 +169,8 @@ export class Store<S extends object> {
P5 extends keyof Object.Path<S, [P1, P2, P3, P4]>,
P6 extends keyof Object.Path<S, [P1, P2, P3, P4, P5]>,
P7 extends keyof Object.Path<S, [P1, P2, P3, P4, P5, P6]>
>(part1: P1, part2: P2, part3: P3, part4: P4, part5: P5, part6: P6, part7: P7): Observable<Object.Path<S, [P1, P2, P3, P4, P5, P6, P7]>>
// tslint:disable-next-line:max-line-length
>(part1: P1, part2: P2, part3: P3, part4: P4, part5: P5, part6: P6, part7: P7): Observable<Object.Path<S, [P1, P2, P3, P4, P5, P6, P7]>>;
// prettier-ignore
onChanges<
P1 extends keyof Object.Path<S, []>,
Expand All @@ -171,7 +181,8 @@ export class Store<S extends object> {
P6 extends keyof Object.Path<S, [P1, P2, P3, P4, P5]>,
P7 extends keyof Object.Path<S, [P1, P2, P3, P4, P5, P6]>,
P8 extends keyof Object.Path<S, [P1, P2, P3, P4, P5, P6, P7]>
>(part1: P1, part2: P2, part3: P3, part4: P4, part5: P5, part6: P6, part7: P7, part8: P8): Observable<Object.Path<S, [P1, P2, P3, P4, P5, P6, P7, P8]>>
// tslint:disable-next-line:max-line-length
>(part1: P1, part2: P2, part3: P3, part4: P4, part5: P5, part6: P6, part7: P7, part8: P8): Observable<Object.Path<S, [P1, P2, P3, P4, P5, P6, P7, P8]>>;
// prettier-ignore
onChanges<
P1 extends keyof Object.Path<S, []>,
Expand All @@ -183,7 +194,8 @@ export class Store<S extends object> {
P7 extends keyof Object.Path<S, [P1, P2, P3, P4, P5, P6]>,
P8 extends keyof Object.Path<S, [P1, P2, P3, P4, P5, P6, P7]>,
P9 extends keyof Object.Path<S, [P1, P2, P3, P4, P5, P6, P7, P8]>
>(part1: P1, part2: P2, part3: P3, part4: P4, part5: P5, part6: P6, part7: P7, part8: P8, part9: P9): Observable<Object.Path<S, [P1, P2, P3, P4, P5, P6, P7, P8, P9]>>
// tslint:disable-next-line:max-line-length
>(part1: P1, part2: P2, part3: P3, part4: P4, part5: P5, part6: P6, part7: P7, part8: P8, part9: P9): Observable<Object.Path<S, [P1, P2, P3, P4, P5, P6, P7, P8, P9]>>;
// prettier-ignore
onChanges<
P1 extends keyof Object.Path<S, []>,
Expand All @@ -196,7 +208,8 @@ export class Store<S extends object> {
P8 extends keyof Object.Path<S, [P1, P2, P3, P4, P5, P6, P7]>,
P9 extends keyof Object.Path<S, [P1, P2, P3, P4, P5, P6, P7, P8]>,
R extends Index[]
>(part1: P1, part2: P2, part3: P3, part4: P4, part5: P5, part6: P6, part7: P7, part8: P8, part9: P9, ...rest: R): Observable<Object.Path<S, Tuple.Concat<[P1, P2, P3, P4, P5, P6, P7, P8, P9], R>>>
// tslint:disable-next-line:max-line-length
>(part1: P1, part2: P2, part3: P3, part4: P4, part5: P5, part6: P6, part7: P7, part8: P8, part9: P9, ...rest: R): Observable<Object.Path<S, Tuple.Concat<[P1, P2, P3, P4, P5, P6, P7, P8, P9], R>>>;

onChanges(...path: Index[]) {
return this.state$.pipe(
Expand Down