mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-25 17:04:16 +00:00
feature(client) io: promisify -> async
This commit is contained in:
parent
807a1bc26d
commit
16a1eade2a
2 changed files with 46 additions and 91 deletions
|
|
@ -2,9 +2,6 @@
|
|||
|
||||
/* global CloudCmd */
|
||||
|
||||
const {promisify} = require('es6-promisify');
|
||||
const tryToCatch = require('try-to-catch');
|
||||
|
||||
CloudCmd.Markdown = exports;
|
||||
|
||||
const createElement = require('@cloudcmd/create-element');
|
||||
|
|
@ -13,8 +10,6 @@ const Images = require('../dom/images');
|
|||
const {Markdown} = require('../dom/rest');
|
||||
const {alert} = require('../dom/dialog');
|
||||
|
||||
const read = promisify(Markdown.read);
|
||||
|
||||
module.exports.init = async () => {
|
||||
Images.show.load('top');
|
||||
await CloudCmd.View();
|
||||
|
|
@ -38,7 +33,7 @@ async function show(name, options = {}) {
|
|||
if (relative)
|
||||
name += relativeQuery;
|
||||
|
||||
const [error, innerHTML] = await tryToCatch(read, name);
|
||||
const [error, innerHTML] = await Markdown.read(name);
|
||||
Images.hide();
|
||||
|
||||
if (error)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue