Skip to content

Commit 74b9987

Browse files
fix(cookies): add valueChange property to server variant
1 parent 6019cc5 commit 74b9987

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

src/modules/cookies/common.ts

+6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
import { Observable } from 'rxjs'
22
import { CookieAttributes } from 'js-cookie'
33

4+
export interface KeyValue {
5+
readonly key: string
6+
readonly value: any
7+
}
8+
49
export interface ICookieService {
10+
readonly valueChange: Observable<KeyValue>
511
readonly valueChanges: Observable<StringDict>
612
readonly getAll: () => any
713
readonly get: (name: string) => any

src/modules/cookies/cookies.browser.service.ts

+1-6
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
11
import { Injectable } from '@angular/core'
22
import { Subject } from 'rxjs'
3-
import { ICookieService, StringDict } from './common'
3+
import { ICookieService, StringDict, KeyValue } from './common'
44
import { CookieAttributes, getJSON, remove, set } from 'js-cookie'
55
import { filter } from 'rxjs/operators'
66

7-
export interface KeyValue {
8-
readonly key: string
9-
readonly value: any
10-
}
11-
127
// tslint:disable:no-this
138
// tslint:disable-next-line:no-class
149
@Injectable()

src/modules/cookies/cookies.server.service.ts

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import * as express from 'express'
99
// tslint:disable-next-line:no-class
1010
@Injectable()
1111
export class ServerCookieService implements ICookieService {
12+
public readonly valueChange = empty()
1213
public readonly valueChanges = empty()
1314

1415
constructor(@Inject(REQUEST) private req: express.Request) {}

0 commit comments

Comments
 (0)