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

docs(audit): fix marble diagram #6636

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions docs_app/assets/images/marble-diagrams/audit.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs_app/src/assets/images/marble-diagrams/audit.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions docs_app/tools/marbles/diagrams/audit.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
-a-xy-----b--x--cxyz-|

----i

----i

----i

> audit()

-----y--------x-----z|
16 changes: 9 additions & 7 deletions spec/operators/audit-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,17 @@ describe('audit operator', () => {

it('should emit the last value in each time window', () => {
testScheduler.run(({ hot, cold, expectObservable, expectSubscriptions }) => {
const e1 = hot(' -a-xy-----b--x--cxxx-|');
const e1subs = ' ^--------------------!';
const e2 = cold(' ----x ');
const e1 = hot(' -a-xy-----b--x--cxyz-|');
const e1subs = ' ^--------------------!';
const e2 = cold(' ----i ');
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated test so that it follows docs_app/tools/marbles/diagrams/audit.txt.

// ----i
// ----i
const e2subs = [
' -^---! ',
' ----------^---! ',
' ----------------^---! '
' -^---! ',
' ----------^---! ',
' ----------------^---! ',
];
const expected = ' -----y--------x-----x|';
const expected = '-----y--------x-----z|';

const result = e1.pipe(audit(() => e2));

Expand Down
2 changes: 1 addition & 1 deletion src/internal/operators/audit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { OperatorSubscriber } from './OperatorSubscriber';
* <span class="informal">It's like {@link auditTime}, but the silencing
* duration is determined by a second Observable.</span>
*
* ![](audit.png)
* ![](audit.svg)
*
* `audit` is similar to `throttle`, but emits the last value from the silenced
* time window, instead of the first value. `audit` emits the most recent value
Expand Down