Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
kormanowsky committed Nov 10, 2020
1 parent 1174652 commit b81ced9
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,22 @@ list.setObject({ myKey: 0 });
setList(list);
```

## New in v2.2.0: .get(), .set(), .keys(), .enabledkeys(), .disabledKeys() and static .checkKey() methods in customized class:
```javascript
const BitList = require("js-bit-list");
const FruitsBitList = BitList.useKeys(["apple", "banana", "orange"])
// .checkKey()
FruitsBitList.checkKey("apple") // -> 0
FruitsBitList.checkKey("tomato") // -> Error
// .get() and .set()
const fruitsList = new FruitsBitList();
fruitsList.get("apple") // -> 0
fruitsList.set("orange", 1);
fruitsList.get("orange") // -> 1
// .enabledKeys(), .disabledKeys(), .keys()
fruitsList.enabledKeys() // -> ["orange"]
fruitsList.disabledKeys() // -> ["apple", "banana"]
fruitsList.keys() // -> ["apple", "banana", "orange"]
```

### See example.js for working example

0 comments on commit b81ced9

Please sign in to comment.