codepen documentation update#375
Conversation
- The exception is identity and serialize - Examples indented by signatures and option don't seem to properly link
|
Continuing to fix. can-define.types.type.html
|
| compute( 2 ); | ||
| map.value; //-> 2 | ||
| ``` | ||
| <!--@codepen--> |
There was a problem hiding this comment.
is this the one that doesn't work?
|
|
||
| const Store = DefineMap.extend( { | ||
| locations: DefineList, | ||
| locations: { Default: DefineList }, |
There was a problem hiding this comment.
locations: DefineList is short-hand for locations: { Type: DefineList }.
There was a problem hiding this comment.
If It's set like that this.locations is undefined in the locationIds getter function.
https://codepen.io/anon/pen/XPmmmZ
There was a problem hiding this comment.
The new keyword was needed in front of DefaultList. Fixed in 73cc278.
There was a problem hiding this comment.
You don't need the new keyword with Default. The problem is just that this example doesn't work. I think your original change to locations: { Default: DefineList } is the correct way to do this. That is how you do what the description says
The following example creates an empty locationIds can-define/list/list when a new instance of Store is created.
Sorry to have led you down the wrong path.
| value: 0 | ||
| }, | ||
| address: { | ||
| value: function() { |
There was a problem hiding this comment.
I think this should be default: function() { ... }.
|
Looks good @HTMLGhozt. Just a couple small things to fix up. |
- Constructor needs `new` keyword in shorthand. I was unable to get it to work properly by just assigning `DefaultList`. - Now returning in map example to properly get and return keys.
phillipskevin
left a comment
There was a problem hiding this comment.
Looks good. Nice work @HTMLGhozt.
Continuing to fix #362
This PR fixes the following issues and continues to update examples across the board.
There's an issue where @codepen doesn't work under @option.
can-define.types.propDefinition.html
defaultoption shows the oldvalue.js.can-define.types.default.html
can-define.types.defaultConstructor.html
can-define.types.get.html
can-define.types.set.html