Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Determine if the locking mechanism can be extracted to a separate place #11442

Closed
ma2ciek opened this issue Mar 9, 2022 · 4 comments
Closed
Labels
resolution:expired This issue was closed due to lack of feedback. status:discussion

Comments

@ma2ciek
Copy link
Contributor

ma2ciek commented Mar 9, 2022

A follow-up to #10496.

After the changes from this PR, we'll have places that share the logic for the lock mechanism (Command#isDisabled and Editor#isReadOnly) This issue is about checking if the logic can be extracted as a mixin or another thing and applied to all places that will need such a mechanism.

Also, we need to think about providing good API as discovering methods for changing properties may be tricky.

@ma2ciek
Copy link
Contributor Author

ma2ciek commented Mar 9, 2022

My API proposal:

class Editor {
    constructor() {
        // The PropertyLock class takes care about the value of a property that can be locked and exposes the API.
        this.readOnlyLock = new PropertyLock( this, 'isReadOnly' );
    }
}

const editor = new Editor();

editor.isReadOnly // an observable read-only property, equals true or false.

editor.readOnlyLock.set( 'foo', value = true );
editor.readOnlyLock.has( 'foo' );
editor.readOnlyLock.clear( 'foo' );

@CKEditorBot
Copy link
Collaborator

There has been no activity on this issue for the past year. We've marked it as stale and will close it in 30 days. We understand it may be relevant, so if you're interested in the solution, leave a comment or reaction under this issue.

@CKEditorBot
Copy link
Collaborator

There has been no activity on this issue for the past year. We've marked it as stale and will close it in 30 days. We understand it may still be relevant, so if you're interested in the solution, leave a comment or reaction under this issue.

@CKEditorBot
Copy link
Collaborator

We've closed your issue due to inactivity over the last year. We understand that the issue may still be relevant. If so, feel free to open a new one (and link this issue to it).

@CKEditorBot CKEditorBot added resolution:expired This issue was closed due to lack of feedback. and removed status:stale labels Jan 15, 2024
@CKEditorBot CKEditorBot closed this as not planned Won't fix, can't repro, duplicate, stale Jan 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
resolution:expired This issue was closed due to lack of feedback. status:discussion
Projects
None yet
Development

No branches or pull requests

2 participants