Skip to content

Commit

Permalink
implement SaveAsync() and updated documentation (#42)
Browse files Browse the repository at this point in the history
* implement SaveAsync() and updated documentation

* fixed re-use of :Save() code, now calls :Save()
  • Loading branch information
quackbox authored and Kampfkarren committed Aug 14, 2019
1 parent 90fd3ad commit 8658e1f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions DataStore2/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
- BeforeInitialGet(modifier)
- BeforeSave(modifier)
- Save()
- SaveAsync()
- OnUpdate(callback)
- BindToClose(callback)
Expand Down Expand Up @@ -405,6 +406,15 @@ function DataStore:Save()
end
end

--[[**
<description>
Asynchronously saves the data to the data store.
</description>
**--]]
function DataStore:SaveAsync()
coroutine.wrap(DataStore.Save)(self)
end

--[[**
<description>
Add a function to be called before the game closes. Fired with the player and value of the data store.
Expand Down

0 comments on commit 8658e1f

Please sign in to comment.