Added my coursework - #14
Open
stanislav7766 wants to merge 2 commits into
Open
Conversation
tshemsedinov
requested changes
Jun 5, 2018
tshemsedinov
left a comment
Member
There was a problem hiding this comment.
Fix naming, improve style
| if (array[index] === '') | ||
| Array.prototype.splice.apply(array, [index, 1].concat(arrayToInsert)); | ||
| else | ||
| Array.prototype.splice.apply(array, [index, 0].concat(arrayToInsert)); |
Member
There was a problem hiding this comment.
Use ternary op or +(logical value) here
| const trouble = ['addToEmpty', 'addWithTrouble']; | ||
| //массив , где элементы - возможжные операции с перезаписью поля | ||
| const applyDelta = (arr, obj) => { //функция , для применения изменений | ||
| // у других клиентов |
| return d; | ||
| }; | ||
| const setDelta = (oldSource, newSource) => { //наша главная функция, | ||
| //в которой мы определяем , какого типа будет наша дельта |
| insertArrayAt(arr, obj.line, obj.data[1]); | ||
| arr.splice(obj.line + 1, 0, ''); | ||
| } else insertArrayAt(arr, obj.line, obj.data[1]); | ||
| } else if (obj.operation === 'addNewLine') { |
Member
There was a problem hiding this comment.
Use collection instead of if else if ...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.