Skip to content

Commit f128b3f

Browse files
committed
Add createLibraryAsync() for async creation
This new function is a just a convenience wrapper around createLibrary(). Instead of immediately returning the library, it waits until the library is initialized.
1 parent a7e1a5f commit f128b3f

File tree

4 files changed

+20
-743
lines changed

4 files changed

+20
-743
lines changed

CHANGELOG.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
## Next
22

3-
_[Changes since v0.9.1](https://github.com/flekschas/piling.js/compare/v0.9.1...master)_
3+
_[Changes since v0.9.1](https://github.com/flekschas/piling.js/compare/v0.10.0...master)_
4+
5+
## v0.10.0
6+
7+
- Added `createLibraryAsync()` to automatically wait until piling is fully initialized. The function takes as input the same parameters as `createLibrary()`.
8+
9+
_[Changes since v0.9.0](https://github.com/flekschas/piling.js/compare/v0.9.1...v0.10.0)_
410

511
## v0.9.1
612

DOCS.md

+6
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,12 @@ An array of objects with one required property `src` and other optional user-def
292292

293293
**Returns:** a new piling instance.
294294

295+
### createLibraryAsync(_domElement_, _initialProperties_)
296+
297+
**Arguments:** Same as [`createLibrary()`](#createlibrarydomelement-initialproperties).
298+
299+
**Returns:** a promise resolving to the new piling instance once the library was initialized.
300+
295301
### createLibraryFromState(_domElement_, _initialProperties_, _options_)
296302

297303
**Arguments:**

0 commit comments

Comments
 (0)