1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-02-24 09:13:24 +01:00
slate/lib/models/data.js
Ian Storm Taylor e9538526ce add data model
2016-06-22 18:42:55 -07:00

33 lines
473 B
JavaScript

import { Map } from 'immutable'
/**
* Data.
*
* This isn't an immutable record, it's just a thin wrapper around `Map` so that
* we can allow for more convenient creation.
*/
const Data = {
/**
* Create a new `Data` with `properties`.
*
* @param {Object} properties
* @return {Data} data
*/
create(properties = {}) {
return Map.isMap(properties)
? properties
: new Map(properties)
}
}
/**
* Export.
*/
export default Data