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

specify method return type in docs #9

Open
isc-rsingh opened this issue Sep 15, 2017 · 2 comments
Open

specify method return type in docs #9

isc-rsingh opened this issue Sep 15, 2017 · 2 comments
Assignees

Comments

@isc-rsingh
Copy link
Member

In each section of the docs, make clear what the return type is

@bradley-holt
Copy link
Contributor

@rajrsingh Do you mean something like this (adding console.log(shoppingList) and the comment after that)?

const { ShoppingListFactory } = require("ibm-shopping-list-model");

const shoppingListFactory = new ShoppingListFactory();

let shoppingList = shoppingListFactory.newShoppingList({
  title: "Groceries"
});

console.log(shoppingList._id);                      // list:…
console.log(shoppingList._rev);                     // undefined
console.log(shoppingList.title);                    // Groceries
console.log(shoppingList);
/*
Record {
    _id: "list:cj7m3o8f8000081f40g5167yj",
    _rev: undefined,
    _deleted: false,
    type: "list",
    version: 1,
    title: "Groceries",
    checked: false,
    place: undefined,
    createdAt: undefined,
    updatedAt: undefined
}
*/

@isc-rsingh
Copy link
Member Author

@bradley-holt showing an entire example Record object is great. I was thinking simply stating the key function name and that it returns an Immutable Record object under the heading, e.g.

Finding a Count of Checked Shopping List Items by Shopping List from a Database

Use a Shopping List Repository to find a count of checked Shopping List Items by Shopping List from a database:

shoppingListRepository.findItemsCountByList({JSON object/selector})

returns: ImmutableJS List

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants