4 code elements have changed.
Fix & commit relevant instances to keep the doc up to dateReview Outdated
When your code changes, Swimm determines if it’s a minor or major change, and your doc is updated.
Change type | Examples | Detection | Manual Action | Automated |
---|---|---|---|---|
Minor change | · A line change · Renaming a variable · A change of key-value pairs | ✅ | Accept Swimm’s suggestion | ✅ |
Major change | · The function was deleted · The line completely changed | ✅ | Accept Swimm’s suggestion | ❌ |
In the example below Swimm detected a minor change in the code.
The developer changed 2 things:
An "<li>" element to a "<div>".
Added a css class "view-template".
Swimm detects code changes and shows the diff.
In order to fix the snippets below, go to edit mode.
Click "Accept" to "fix" it.
<div data-id="${item.id}"${item.completed ? ' class="completed"' : ''}>
<div class="view view-template">
<input class="toggle" type="checkbox" ${item.completed ? 'checked' : ''}>
<label>${escapeForHTML(item.title)}</label>
<button class="destroy"></button>
</div>
</div>`, '');
In this example, the function has been completely refactored and and Swimm considers this a major change.
At this point, the person familiar with change should get a decision. Either to replace this snippet to the correct one, or remove it.
Fix this snippet 👇 - use the "Reselect" button below...
This function
and remove
objects in the filter
array based on matching key-value pairs in a query object and passes the result to a callback function.todos
find(query, callback) {
const todos = this.getLocalStorage();
let k;
callback(todos.filter(todo => {
for (k in query) {
if (query[k] !== todo[k]) {
return false;
}
}
return true;
}));
}
Your code-coupled elements are now updated in your doc.
The next step would be to commit your changes to your repository, open a pull request and merge your branches for your team to have the latest documentation.
Users mentioned will be listed here.
Type @
to mention another user.
This code creates a dynamic HTML list
item
element using JavaScript template literals and data from an item object.we're using the
escapeForHTML
helper function to replaces '&' and '<' with their HTML entity equivalents to prevent XSS.