diff --git a/src/transforms/call.js b/src/transforms/call.js index 4e737dec6..3831e5cbd 100644 --- a/src/transforms/call.js +++ b/src/transforms/call.js @@ -1,31 +1,14 @@ + /** - * Convenience method to call a custom transform function using easier to read - * syntax. A custom transform is a JavaScript function that takes a Transform - * instance as the first argument. Any additional arguments passed to the `call` - * method after the Transform instance are passed to the custom transform function. - * - * These are equivalent but the second is easier to read: - * - * ```js - * const transform = state.transform() - * myTransform(transform, 0, 1) - * return transform.insertText('hello').apply() - * ``` - * - * and - * - * ```js - * state.transform() - * .call(myTransform, 0, 1) - * .insertText('hello') - * .apply() - * ``` + * Call a `fn` as if it was a core transform. This is a convenience method to + * make using non-core transforms easier to read and chain. * * @param {Transform} transform + * @param {Function} fn * @param {Mixed} ...args */ export default function call(transform, fn, ...args) { fn(transform, ...args) return -} \ No newline at end of file +}