mirror of
https://github.com/Choices-js/Choices.git
synced 2024-06-10 09:52:18 +02:00
Rename _clearChoices to clearChoices
This commit is contained in:
parent
bbbc31594c
commit
fc9bca2ece
|
@ -417,7 +417,7 @@ class Choices {
|
|||
|
||||
// Clear choices if needed
|
||||
if (replaceChoices) {
|
||||
this._clearChoices();
|
||||
this.clearChoices();
|
||||
}
|
||||
|
||||
this.containerOuter.removeLoadingState();
|
||||
|
@ -448,6 +448,10 @@ class Choices {
|
|||
return this;
|
||||
}
|
||||
|
||||
clearChoices() {
|
||||
this._store.dispatch(clearChoices());
|
||||
}
|
||||
|
||||
clearStore() {
|
||||
this._store.dispatch(clearAll());
|
||||
return this;
|
||||
|
@ -1729,10 +1733,6 @@ class Choices {
|
|||
}
|
||||
}
|
||||
|
||||
_clearChoices() {
|
||||
this._store.dispatch(clearChoices());
|
||||
}
|
||||
|
||||
_addGroup({ group, id, valueKey = 'value', labelKey = 'label' }) {
|
||||
const groupChoices = isType('Object', group)
|
||||
? group.choices
|
||||
|
|
|
@ -1339,14 +1339,14 @@ describe('choices', () => {
|
|||
addChoiceStub = stub();
|
||||
containerOuterRemoveLoadingStateStub = stub();
|
||||
|
||||
instance._clearChoices = clearChoicesStub;
|
||||
instance.clearChoices = clearChoicesStub;
|
||||
instance._addGroup = addGroupStub;
|
||||
instance._addChoice = addChoiceStub;
|
||||
instance.containerOuter.removeLoadingState = containerOuterRemoveLoadingStateStub;
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
instance._clearChoices.reset();
|
||||
instance.clearChoices.reset();
|
||||
instance._addGroup.reset();
|
||||
instance._addChoice.reset();
|
||||
instance.containerOuter.removeLoadingState.reset();
|
||||
|
|
Loading…
Reference in a new issue