diff --git a/CHANGELOG.md b/CHANGELOG.md index deacedf..f1033c0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,13 @@ # CHANGELOG +## pending + +* Fixed package author email (#16) +* Fixed docs (#17) + ## 3.0.1 -* Fixed docs (issue #13) +* Fixed docs (#13) ## 3.0.0 @@ -22,7 +27,7 @@ Here is the full list of API changes: This lifecycle hook can be used to remove all event listeners registered in a component. * `App#model` now accepts not an actual data object, but an instance of `Model`. `Model` is another factory exported from `athletic`. - It's intended to being called without the `new` keyword. + It's intended to be called without the `new` keyword. You can pass your data to the factory function when creating an instance of `Model`: ```typescript diff --git a/README.md b/README.md index e9db818..7dad54b 100644 --- a/README.md +++ b/README.md @@ -40,9 +40,7 @@ Example: import {App, Model} from 'athletic'; var model = Model({first_name: 'John', last_name: 'Doe'}); -var app = new App(); - -app.model(model); +App().model(model); ``` This method returns `App` instance itself to support method chaining. diff --git a/package.json b/package.json index 6ccff22..55415e8 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ "declarative", "component" ], - "author": "Anton Telesh ", + "author": "Anton Telesh ", "license": "MIT", "dependencies": { "lodash": "^4.6.1" diff --git a/test/Model.test.ts b/test/Model.test.ts index 873756c..4a21f60 100644 --- a/test/Model.test.ts +++ b/test/Model.test.ts @@ -52,5 +52,18 @@ test('Model', t => { t.end(); }); + t.test('getState()', t => { + + let model = Model({prop: 'value'}); + + t.deepEqual(model.getState(), {prop: 'value'}); + + model.set('prop', 'value1'); + + t.deepEqual(model.getState(), {prop: 'value1'}); + + t.end(); + }); + t.end(); });