Skip to content

Commit

Permalink
Feat: Add global trigger for throwing behaviour and add global pKey s…
Browse files Browse the repository at this point in the history
…etter

chore: update dependencies
docs: update docs for new version and some corrections
tests: update tests to check changes

BREAKING CHANGE:
__Throwable__
The throwable behaviour is customizable per method or can be overriden with a global flag.
For data fetching methods, the default behaviour is to return undefined. For a few sensible methods like empty, the default behaviour is to raise a TypeError exception.

__Parent key__
It is now possible to globally set a parent key to work on a subset without providing it as parameter each time
  • Loading branch information
liqueurdetoile committed Mar 15, 2018
1 parent a1be7aa commit b8fd177
Show file tree
Hide file tree
Showing 21 changed files with 45,295 additions and 32,724 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,16 @@ doa.pull('dat.long.and.far.away.key');

// And many more !
```
## Configuring ObjectArray behaviour when a required key doesn't exist
In version 1.x, a non-existent key yields to an `undefined` returned value.

In version 2.x, a non-existent key data request raises an exception except for some methods that can leverage a throwable trigger.

Since version 3.x, the behaviour can be configure per method call or override globally. Each data request have a predefined behaviour
given its goal. For instance, the empty method will throw an exception by default and a dataset call will return undefined by default.

Please check [API reference](https://liqueurdetoile.github.io/DotObjectArray/docs/identifiers.html) for details.

## Playground
If you want to go further and try a bit, you [can go to the playground](https://jsfiddle.net/dx03k9sL/19/).

Expand Down
2 changes: 1 addition & 1 deletion dist/objectarray.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit b8fd177

Please sign in to comment.