sticky-identity
Transformware that maintains consistent object identity when using a sticky datastore.
Installation
$ npm install sticky-identity
Usage
Assuming we have a sticky Datastore
as
db
and some sourced repository for the User
model:
var identity = ; db;
Model identity is consistent now across all calls.
var user = ;useremail = 'awesome@cool.net';dbuser ;
Identity is checked via the id
parameter by default, but can be determined by
any string-like return value from a function argument:
db;
Keep in mind that the memory usage of this transformware will scale as the number ofunique objects that are output or input into the repository grows.
Testing
$ npm test
License
MIT