我创建了以下函数来删除用户,它是专用的集合,运行良好。
import * as admin from 'firebase-admin';
import * as functions from 'firebase-functions';
admin.initializeApp();
const Auth = admin.auth();
const UsersCollection = admin.firestore().collection(`users`);
exports.deleteUser = functions.https.onCall((data, context) => {
if (context.auth) {
const userID = context.auth.uid;
Auth.deleteUser(userID)
.then(() => {
UsersCollection.doc(userID).delete()
.catch(error => {
console.log(error)
})
})
.catch(error => {
console.log(error)
})
}
});
Run Code Online (Sandbox Code Playgroud)
然后我尝试覆盖到 promise.all 中,以便用户的集合删除不必等到用户实际删除。所以我尝试执行以下操作:
exports.deleteUser = functions.https.onCall((data, context) => {
if (context.auth) {
const userID = context.auth.uid;
const promises = [];
const deleteCollection = UsersCollection.doc(userID).delete();
promises.push(Auth.deleteUser(userID));
promises.push(deleteCollection);
return …Run Code Online (Sandbox Code Playgroud) 我已经在GitHub上删除了我的存储库并尝试创建一个本地存储库.
当我这样做: remote show origin
结果是:
remote: Repository not found.
fatal: repository 'https://github.com/userName/repositoryName.git/' not found
Run Code Online (Sandbox Code Playgroud) 我已经阅读了官方文档,但无法找到有关放大/缩小panorama图像的可能性的信息,它是否在 A-Frame 中受支持,或者可能有一种解决方法可以阅读有关three.js在其上实现的一些内容?
该问题的目的是调查执行以下操作的可能性:
.element:before {
content: 'before';
color: orange;
}
.element:after {
content: 'after';
color: green;
}
.element:after:hover + .element:before {
color: red;
}Run Code Online (Sandbox Code Playgroud)
<div class='element'> </div>Run Code Online (Sandbox Code Playgroud)
目前,该项目有一个 CommonJS 模块,用于存储仅在一个文件中维护的配置值:
module.exports = {
classA: `classA`,
classB: `classB`
classC: `classC`
}
Run Code Online (Sandbox Code Playgroud)
这允许稍后重用它们来生成 JS 选择器,方法是:
const CLASSES = require('./classes')
const SELECTORS = Object.keys(CLASSES).reduce((obj, key) => {
const selectorKey = key.replace(`class`, `selector`)
obj[selectorKey] = `.${CLASSES[key]}`
return obj
}, {})
module.exports = SELECTORS
Run Code Online (Sandbox Code Playgroud)
选择器稍后也会在代码逻辑中使用,并传递给 PostCSS 配置,后者生成要在.pcss文件中使用的变量列表。
这一切都非常方便,有助于开发流程,而且 CommonJS 允许在需要时仅将特定值导入组件,例如:
import { classA } from './path/classes
它的工作就像一个梦想,而且仍然如此,但是,在打字稿文件中以相同的方式导入它不满足 tslint 约束,并且它会发出错误警告:
Could not find a declaration file for module implicitly has an 'any' type::
这是tsconfig.json
{
"compilerOptions": {
"target": "esnext", …Run Code Online (Sandbox Code Playgroud) 当前代码片段的目的是在新的终端窗口中运行脚本并立即隐藏它。下面的代码最初似乎工作正常,但结果是,如果使用其可见属性操作窗口,它就会消失并且似乎没有执行。右键单击显示Terminal中的应用程序Dock,就像根本没有终端窗口一样。
tell application "Terminal"
-- New Terminal Window
set newTab to do script "caffeinate -u -t 900"
set caffeinateWindow to id of front window
tell window id caffeinateWindow
set index to 1
set visible to false
end tell
end tell
Run Code Online (Sandbox Code Playgroud) 该元素包含以下内容,其中所需的解决方案是清除除了单词和空格之间的"所有内容"
var textContent = " +(269) Yukon Makukon"
var cleanContent = textContent.replace(/[^A-Za-z]/g, ``)
document.write(cleanContent); Run Code Online (Sandbox Code Playgroud)
有没有办法隐藏/禁用控件选项date和time输入的类型,通过单击箭头允许递增/递减值.
<input type='date' />
<input type='time' />Run Code Online (Sandbox Code Playgroud)
并在同一时间有可能为每个段提供数据,如dd从dd/mm/yyyy(basicly只是隐藏控件)
例如,可以设置resize: nonetextarea.
textarea {
resize: none;
width: 200px;
height: 100px;
}Run Code Online (Sandbox Code Playgroud)
<textarea />Run Code Online (Sandbox Code Playgroud)
css ×2
javascript ×2
typescript ×2
aframe ×1
applescript ×1
commonjs ×1
css3 ×1
firebase ×1
git ×1
github ×1