New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make models streamable #166
Conversation
} | ||
|
||
Model.prototype.get = function get(key) { | ||
function getFromAttributes(attributes, key) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just curious, why you are not adding any description (eg jsdoc)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
till now, we have always maintained the API documentation in package's own README whenever we made changes in code. but I agree jsdoc would be a better approach.
would really welcome PRs to speed that process up :)
const person = new Person({ name: 'Helga Hufflepuff' }); | ||
person.get$().subscribe(function (personAttributes) { | ||
expect(personAttributes).to.deep.equal({ | ||
name: 'Helga Hufflepuff', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❤️
What's done
Models now support Observables, for streaming changes as they happen. This would be of very high impact for dealing with forms in observed React components.
Usage
Import:
Create Model class:
Building a new model instance:
The model instance can also be observed for changes: