Returns a new instance of this Record type with all values set
to their default values.
Returns this
delete
delete(key: K): this
Returns a new instance of this Record type with the value for the
specific key set to its default value.
alias
remove
Type parameters
K: keyof Properties
Parameters
key: K
Returns this
deleteIn
deleteIn(keyPath: Iterable<any>): this
alias
removeIn
Parameters
keyPath: Iterable<any>
Returns this
equals
equals(other: any): boolean
Parameters
other: any
Returns boolean
get
get(key: K, notSetValue?: any): TProps[K]
get(key: string, notSetValue: T): T
Returns the value associated with the provided key, which may be the
default value defined when creating the Record factory function.
If the requested key is not defined by this Record type, then
notSetValue will be returned if provided. Note that this scenario would
produce an error when using Flow or TypeScript.
Type parameters
K: keyof Properties
Parameters
key: K
Optional notSetValue: any
Returns TProps[K]
Type parameters
T
Parameters
key: string
notSetValue: T
Returns T
getDefaultHighlightStyle
getDefaultHighlightStyle(): this
Get automatically computed highlight style.
Returns this
FillStyle object
getDescriptiveName
getDescriptiveName(record: Record<any>): string
Records allow passing a second parameter to supply a descriptive name
that appears when converting a Record to a string or in any error
messages. A descriptive name for any record can be accessed by using this
method. If one was not provided, the string "Record" is returned.
const { Record } = require('immutable')
const Person = Record({
name: null
}, 'Person')
var me = Person({ name: 'My Name' })
me.toString() // "Person { "name": "My Name" }"
Record.getDescriptiveName(me) // "Person"
Parameters
record: Record<any>
Returns string
getIn
getIn(keyPath: Iterable<any>): any
Parameters
keyPath: Iterable<any>
Returns any
has
has(key: string): boolean
Parameters
key: string
Returns boolean
hasIn
hasIn(keyPath: Iterable<any>): boolean
Parameters
keyPath: Iterable<any>
Returns boolean
hashCode
hashCode(): number
Returns number
isRecord
isRecord(maybeRecord: any): boolean
True if maybeRecord is an instance of a Record.
Parameters
maybeRecord: any
Returns boolean
merge
merge(...collections: Array<Partial<Properties> | Iterable<[string, any]>>): this
Base interface for fillstyles.