Skip to content

Commit 2caca5e

Browse files
committed
fix(text): callback added in text
1 parent 7b82403 commit 2caca5e

7 files changed

Lines changed: 11 additions & 21 deletions

File tree

demo/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ <h1>Loading embed.js in a block</h1>
9595
console.log(data);
9696
});
9797

98-
x.text().then(function(data) {
98+
x.text(function(data) {
9999
console.log(data)
100100
});
101101

dist/embed.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/embed.es2015.js

Lines changed: 2 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/embed.es2015.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/embed.js

Lines changed: 3 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/embed.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/js/main.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -311,12 +311,8 @@ export default class EmbedJS {
311311
* returns the resulting string based on the input and the options passed by the user.
312312
* @return Promise
313313
*/
314-
text() {
315-
return new Promise((resolve) => {
316-
this.process().then(() => {
317-
resolve(this.data)
318-
})
319-
})
314+
text(callback) {
315+
this.process().then((data)=> callback(data, this.input))
320316
}
321317

322318
/**

0 commit comments

Comments
 (0)