Useful utils
npm install @cobalt-engine/utilssource object to target object. Returns target object. keys - array of property names to copy (if not specified - all properties will be copied).
keys as property names and values as property values.
map as array of its elements. Each element in the array is maps element extended with its id in the map. Example:
string - template
data - data object
data in pattern string.
value is beyond the range [min..max] the nearest limit will be returned. Example:
target - element which receives event
event - event name
options - object with settings, transferred to constructor CustomEvent.
detail for transmission of additional information.
Observer constructor:
subscribe(event, callback) - adds callback for event. When event publishes Observer executes callback
unsubscribe(event, callback) - removes callback listener for event event
publish(event, data) - create an event event and send data to all listeners of this event.
destroy() - removes all added subscriptions