Skip to content

Commit

Permalink
Merge pull request #11 from webKrafters/pdeps
Browse files Browse the repository at this point in the history
type def and readme updates
  • Loading branch information
steveswork committed Jun 2, 2024
2 parents 434e4bf + 3df9dc9 commit a15c5e4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,13 @@ import myImmutable from './my-immutable';

const consumer = myImmutable.connect();

const objectPath = 'a.b.c';
const objectPaths = [ 'a.b.c', 'a.b' ];

const data : AccessorResponse = consumer.get( objectPath );

console.log( data ); // { 'a.b.c', 24 }
const data : AccessorResponse = consumer.get( ...objectPaths );
// => data = {
// 'a.b': { c: 24 },
// 'a.b.c': 24
// }
```

### Manually Discard an AutoImmutable Consumer.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,5 +68,5 @@
"test:watch": "jest --updateSnapshot --watchAll"
},
"types": "dist/index.d.ts",
"version": "1.0.1-rc.0"
"version": "1.0.1"
}
2 changes: 1 addition & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export class Immutable<T extends Value = Value> extends Closable {

@invoke
connect() {
return new Connection(
return new Connection<T>(
`${ deps.numCreated }:${ ++this.#numConnectionsCreated }`, {
key: this,
map: Immutable.#cacheMap
Expand Down

0 comments on commit a15c5e4

Please sign in to comment.