Methods
(static) createObservable(onChangeopt, objReferenceopt, batchUpDelayopt) → {ProxyConstructor}
Create an observable object
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
onChange | function | <optional> | Callback triggered on change. Default is undefined. | |
objReference | object | <optional> | Referenced object which will be transformed to an observable. Default is an empty new object. | |
batchUpDelay | boolean | <optional> | true | Flag defining if change events are batched up for 10ms before being triggered. Default is true. |
- Source
Returns:
- Type:
- ProxyConstructor
(static) createUid() → {string}
Creates an unique ID
- Source
Throws:
- If crypto module is not available
- Type
- Error
Returns:
- Type:
- string
(static) deepMerge(target, …sources) → {Object}
Deep merges two objects into target
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
target | Object | ||
sources | Object | <repeatable> |
- Source
Returns:
- Type:
- Object
Example
const merged = mergeDeep({a: 1}, { b : { c: { d: { e: 12345}}}});
// => { a: 1, b: { c: { d: [Object] } } }
(static) isArray(v) → {boolean}
Checks if given value is an array or not
Parameters:
Name | Type | Description |
---|---|---|
v | * | Value to check |
- Source
Returns:
- Type:
- boolean
(static) isClass(v) → {boolean}
Checks if given value is a class constructor
Parameters:
Name | Type | Description |
---|---|---|
v |
- Source
Returns:
- Type:
- boolean
(static) isPlainObject(value) → {boolean}
Checks if given value is a plain object
Parameters:
Name | Type | Description |
---|---|---|
value |
- Source
Returns:
- Type:
- boolean
(static) isString(v) → {boolean}
Checks if given value is string
Parameters:
Name | Type | Description |
---|---|---|
v | * | Value to check |
- Source
Returns:
- Type:
- boolean
(static) serializeForm(form) → {object}
Serialize given from
Parameters:
Name | Type | Description |
---|---|---|
form | HTMLFormElement | The form element to serialize |
- Source
Returns:
- Plain javascript object containing the name and value of given form.
- Type:
- object
(static) trim(str, characters, flags) → {string}
Parameters:
Name | Type | Default | Description |
---|---|---|---|
str | string | String to trim | |
characters | string | | Characters to trim. Default is empty space. | |
flags | string | | g | RegExp flag. Default is "g" |
- Source
Returns:
- Type:
- string