mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
add some docstring
This commit is contained in:
@@ -68,6 +68,9 @@ export class EventBus {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove all subscriptions.
|
||||
*/
|
||||
clear() {
|
||||
this.subscriptions = {};
|
||||
}
|
||||
|
||||
@@ -27,7 +27,10 @@ export function htmlTrim(s: string): string {
|
||||
return result;
|
||||
}
|
||||
|
||||
export function idGenerator(): (() => number) {
|
||||
/**
|
||||
* Create a function that will generate unique id numbers
|
||||
*/
|
||||
export function idGenerator(): () => number {
|
||||
let nextID = 1;
|
||||
return () => nextID++;
|
||||
}
|
||||
@@ -88,6 +91,12 @@ interface Tree<T> {
|
||||
children: T[];
|
||||
}
|
||||
|
||||
/**
|
||||
* Find a node in a tree.
|
||||
*
|
||||
* This will traverse the tree (depth first) and return the first child that
|
||||
* matches the predicate, if any
|
||||
*/
|
||||
export function findInTree<T extends Tree<T>>(
|
||||
tree: T,
|
||||
predicate: (t: T) => boolean
|
||||
|
||||
@@ -3,6 +3,10 @@ import { rpcMixin } from "./rpc_mixin";
|
||||
import { Widget } from "../widget";
|
||||
import { View } from "../views/view";
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Types
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
export type Context = { [key: string]: any };
|
||||
|
||||
export interface CommonActionInfo {
|
||||
|
||||
Reference in New Issue
Block a user