Skip to content
This repository has been archived by the owner on Oct 1, 2018. It is now read-only.

docs(operators): add documentation for every #331

Open
wants to merge 2 commits 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
1 change: 0 additions & 1 deletion rxjs-docs
Submodule rxjs-docs deleted from 5059b4
57 changes: 55 additions & 2 deletions src/operator-docs/conditional/every.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,59 @@
import { OperatorDoc } from '../operator.model';

export const every: OperatorDoc = {
'name': 'every',
'operatorType': 'conditional'
name: 'every',
operatorType: 'conditional',
signature: 'public every(predicate: function, thisArg: any): Observable',
parameters: [
{
name: 'predicate',
type: 'function',
attribute: '',
description:
'A function for determining if an item meets a specified condition.'
},
{
name: 'thisArg',
type: 'any',
attribute: 'optional',
description: `Optional object to use for 'this' in the callback.`
}
],
shortDescription: {
description:
'Returns an Observable that emits whether or not every item of the source satisfies the condition specified.'
},
walkthrough: {
description: `
<p>Each value from source, pass predicate returns true otherwise false.</p>
`
},
examples: [
{
name:
'A simple example emitting true if all elements are less than 5, false otherwise',
code: `
import { every } from 'rxjs/operators';
import { of } from 'rxjs/observable/of';

const source = of(1, 2, 3, 4, 5, 6);
const result = source.pipe(
//is each valule lesser than 5?
every(x => x < 5)
);
const subscription = result.subscribe(x => console.log(x));

/*
Example console output
false
*/
`,
externalLink: {
platform: 'JSBin',
url: 'http://jsbin.com/watafir/embed?js,console'
}
}
],
relatedOperators: [],
additionalResources: []
};