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

Updated examples to can-define/list/list. #377

Merged
merged 57 commits into from
Aug 28, 2018
Merged

Conversation

indifferentghost
Copy link
Contributor

@indifferentghost indifferentghost commented Aug 24, 2018

This is focused on documentation updates in regard to #370. It is moving DefineList documentation to their own markdown files, updating their syntax and having them link to codepen.

can-define/list/list.prototype.assign.html

  • A codepen-able example with syntax highlighting.
  • Needs ES6 syntax.

can-define/list/list.prototype.assignDeep.html

  • A codepen-able example with syntax highlighting.
  • Needs ES6 syntax.

can-define/list/list.prototype.concat.html

  • Use needs syntax highlighting.
  • ES6 syntax.

can-define/list/list.prototype.every.html

  • syntax highlighting.
  • codepen-able examples.
  • Needs ES6 syntax.

can-define/list/list.prototype.filter.html

  • syntax highlighting.
  • codepen-able examples.
  • Needs ES6 syntax.

can-define/list/list.prototype.forEach.html

  • syntax highlighting.
  • codepen-able examples.
  • Needs ES6 syntax.

can-define/list/list.prototype.get.html

  • codepen-able examples.
  • Needs ES6 syntax.

can-define/list/list.prototype.indexOf.html

  • codepen-able examples.
  • Needs ES6 syntax.
  • Syntax highlighting.

can-define/list/list.prototype.join.html

  • codepen-able examples.
  • Needs ES6 syntax.
  • Syntax highlighting.

can-define/list/list.prototype.lastIndexOf.html

  • codepen-able examples.
  • Needs ES6 syntax.
  • Syntax highlighting.

can-define/list/list.prototype.map.html

  • codepen-able examples.
  • Needs ES6 syntax.

can-define/list/list.prototype.pop.html

  • codepen-able examples.
  • Needs ES6 syntax.
  • Syntax highlighting.

can-define/list/list.prototype.push.html

  • codepen-able examples.
  • Needs ES6 syntax.
  • Syntax highlighting

can-define/list/list.prototype.reduce.html

  • Needs ES6 syntax.
  • codepen-able examples.

can-define/list/list.prototype.reduceRight.html

  • Needs relevant example. (example currently is using reduce.)
  • codepen-able example.

can-define/list/list.prototype.replace.html

  • Syntax highlighting.
  • codepen-able example.
  • Needs ES6 syntax.

can-define/list/list.prototype.reverse.html

  • Syntax highlighting
  • Needs ES6 syntax.
  • codepen-able example.

can-define/list/list.prototype.serialize.html

  • Syntax highlighting
  • Needs ES6 syntax.
  • codepen-able example.

can-define/list/list.prototype.set.html

  • Needs ES6 syntax.
  • codepen-able example.

can-define/list/list.prototype.shift.html

  • Syntax highlighting
  • Needs ES6 syntax.
  • codepen-able example.

can-define/list/list.prototype.slice.html

  • Syntax highlighting
  • Needs ES6 syntax.
  • codepen-able example.

can-define/list/list.prototype.some.html

  • Syntax highlighting
  • Needs ES6 syntax.
  • codepen-able example.

can-define/list/list.prototype.sort.html

  • Needs ES6 syntax.
  • codepen-able example.
  • Open and empty example after the signature.

can-define/list/list.prototype.splice.html

  • Needs ES6 syntax.
  • codepen-able example.
  • Syntax highlighting.

can-define/list/list.prototype.unshift.html

  • Needs ES6 syntax.
  • codepen-able example.
  • Syntax highlighting.

can-define/list/list.prototype.update.html

  • Needs ES6 syntax.
  • codepen-able example.

can-define/list/list.prototype.updateDeep.html

  • Needs ES6 syntax.
  • codepen-able example.

Sorry, something went wrong.

@indifferentghost indifferentghost self-assigned this Aug 24, 2018
…yntax highlighting and updated to ES6 syntax. Example now links to codepen.
…nk to codepen. Syntax highlighting. Updated to ES6.
…x highlighting, are Codepenable and in ES6 syntax.
…ks to codepen, has syntax highlighting and uses ES6 syntax.
…ated syntax to ES6, provided example for reduceRight.
…6 added syntax highlighting. Links to codepen.
…syntax highlighting and updated to ES6. changed IndexOf and lastIndexOf to double quotes to match the rest of the examples.
…ntax and highlighting added. Examples are linked to codepen.
…e highlighted and using ES6 syntax. It's codepenable.
…lighted and ES6. It's codepenable. Updated example to better relate to similarities across the documentation.
@indifferentghost indifferentghost changed the title [WIP DON'T MERGE] Updated examples to can-define/list/list. Updated examples to can-define/list/list. Aug 24, 2018
@indifferentghost
Copy link
Contributor Author

indifferentghost commented Aug 28, 2018

Went through the docs once more checking for possible issues:

list.prototype.assign

import { DefineList } from "can";

const list = new DefineList(["A","B"]);

list.assign( {count: 1000, skip: 2} );
console.log( list.count ); //-> 1000



remove skip: 2.

- should this go into when to use list.get(‘count’) vs list.count?

## list.prototype.assignDeep.html
Example has a bug where it doesn’t properly assign age in nested DefineMap.

  • A list or array of values -> list like series of values referencing can-reflect.isListLike.html


## list.prototype.concat.html

  • Still using ES5 syntax
  • Is it possible to show that it’s a list element that also can include any object?

list.prototype.forEach.html

  • Use example should be moved into forEach and use heading deleted.

list.prototype.get.html

  • This should elaborate the difference between using .get and bracket and dot notation.

list.prototype.indexOf.html

  • Should elaborate that it will find the index of the first value.
  • Article is a stub.
  • It might be worth noting that this works off of object equality.

list.prototype.join.html

  • DefineList"s -> DefineList’s
  • Article is a stub.

list.prototype.push.html

  • Remove the first use case

list.prototype.reduceRight.html

  • reduce -> reduce right (first paragraph)

list.prototype.reverse.html

  • Might be worth noting that it mutates the original array
  • It would be nice to have a further elaboration of what being setup for stringily means.

list.prototype.slice.html

  • “end {Number}: The first index not to include in the copy If end is not supplied, slice will copy until the end of the list.” How is this any different from default.
  • More verbose in Use, it’s a shallow copy of the list, how does that interact with extensions

list.prototype.splice.html

  • Signature needs example.

list.prototype.updateDeep

  • Example needs to update ‘Justin’ to “JUSTIN”
  • Should probably log Justin object.

Sorry, something went wrong.

Assigns the properties on the list with `newProps`. Properties not present in `newProps` will be left unchanged.

```js
import { DefineList } from "can";
Copy link
Contributor

Choose a reason for hiding this comment

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

indent 2 spaces

const result = list.concat(
[1,2],
new DefineList(["X","Y"]),
{value: "Z"}
Copy link
Contributor

Choose a reason for hiding this comment

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

there's some spacing issues here

@indifferentghost indifferentghost merged commit 1986d97 into master Aug 28, 2018
@indifferentghost indifferentghost deleted the 370-mapExamples branch August 28, 2018 22:24
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

Successfully merging this pull request may close these issues.

None yet

2 participants