Skip to content

Types

Compare
Choose a tag to compare
@codebryo codebryo released this 26 Nov 14:24
· 12 commits to master since this release

This release marks a first exciting step into a new and better direction for Modelist. The main src files have all been updated to use typescript, and along the path, some things got improved, updated or fixed.
Overall this might not be the most exciting release feature-wise, but this was an important step to make before Modelist will be extended. I am looking into providing a well-written definition file as a patch asap. (Still learning 🤷‍♂️ ).
There is one interesting change that should not break anyone's application, but here we go:

Removed convert option:

In the configuration of a new Model, there was the convert option that needed to be set to true if basic values should be updated to objects when record was called.
Actually, this does not make a lot of sense, because you can use almost nothing that Modelist brings along if the record would be a single value.
Now all simple values will now be converted to an object by default with the primaryKey added!

model.record(...[1, 'fred'])

model.all() // [{ id: uuid(), value: 1 }, { id: uuid(), value: 'fred' }]

Thanks,
Roman