feat: support in memory transaction update (#972)
* feat: support in memory transaction update * test: support in memory transaction update
This commit is contained in:
parent
6009429e58
commit
5b3878dcc5
1 changed files with 41 additions and 15 deletions
|
|
@ -28,5 +28,22 @@ void main() async {
|
|||
await editorState.apply(transaction);
|
||||
expect(count, 2);
|
||||
});
|
||||
|
||||
test('transaction stream', () async {
|
||||
final editorState = EditorState.blank(
|
||||
withInitialText: false,
|
||||
);
|
||||
var isInMemoryUpdate = false;
|
||||
editorState.transactionStream.listen((event) {
|
||||
isInMemoryUpdate = event.$3.inMemoryUpdate;
|
||||
});
|
||||
final transaction = editorState.transaction;
|
||||
transaction.insertNode([0], paragraphNode(text: 'Hello World!'));
|
||||
await editorState.apply(
|
||||
transaction,
|
||||
options: const ApplyOptions(inMemoryUpdate: true),
|
||||
);
|
||||
expect(isInMemoryUpdate, true);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue