Skip to content
This repository has been archived by the owner on Sep 30, 2023. It is now read-only.

Feat/optional pin #81

Merged
merged 2 commits into from
Dec 5, 2019
Merged

Feat/optional pin #81

merged 2 commits into from
Dec 5, 2019

Conversation

shamb0t
Copy link
Contributor

@shamb0t shamb0t commented Nov 29, 2019

Pass optional arguments to log.append

src/Store.js Outdated
@@ -470,14 +469,14 @@ class Store {
}
}

async _addOperation (data, batchOperation, lastOperation, onProgressCallback) {
async _addOperation (data, { batchOperation, lastOperation, onProgressCallback, pin = false } = {}) {
Copy link
Member

Choose a reason for hiding this comment

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

This means the API changes and needs changes in all stores. How about instead adding pin as the last arg and keep the current API?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@haadcode Seems to me all the stores need to be changed regardless in order to pass the options, no?

Copy link
Member

Choose a reason for hiding this comment

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

To pass (use/enable) the option yes, but if they don't change anything, their old code still works as expected, whereas changing the API would require all dependants to change their _addOperation() calls to match the changed API.

@haadcode
Copy link
Member

haadcode commented Dec 5, 2019

LGTM 👍

@shamb0t shamb0t merged commit 1d3495f into master Dec 5, 2019
@shamb0t shamb0t deleted the feat/optional-pin branch December 5, 2019 09:43
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants