AppFlowy/frontend/app_flowy/lib/util/either_extension.dart
Lucas.Xu 7c3a823078
feat: add openai service (#1858)
* feat: add openai service

* feat: add openai auto completion plugin

* feat: add visible icon for open ai input field

* chore: optimize user experience

* feat: add auto completion node plugin

* feat: support keep and discard the auto generated text

* fix: can't delete the auto completion node

* feat: disable ai plugins if open ai key is null

* fix: wrong auto completion node card color

* fix: make sure the previous text node is pure when using auto generator
2023-02-16 10:17:08 +08:00

7 lines
158 B
Dart

import 'package:dartz/dartz.dart';
extension EitherX<L, R> on Either<L, R> {
R asRight() => (this as Right).value;
L asLeft() => (this as Left).value;
}