From bc3fdd136fad5d1746e4c2aac78cce86c8a36046 Mon Sep 17 00:00:00 2001 From: Nikita Nikolashyn <44834471+nnikolash@users.noreply.github.com> Date: Wed, 25 Sep 2024 00:39:21 +0300 Subject: [PATCH] Update README.md --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 3f6de27..c14bfdb 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,9 @@ type TestEvent struct { ###### Create sparse series ``` +// Data storate factory +dataStorageFactory := sparse.NewArrayData[TestEvent, time.Time] + // Getter of index getIdx := func(data *TestEvent) time.Time { return data.Time @@ -40,7 +43,7 @@ areContinuous := func(smaller, bigger time.Time) bool { return smaller.UnixNano() == bigger.UnixNano()+1 } -series := sparse.NewSeries(dataFactory, getIdx, cmp, areContinuous) +series := sparse.NewSeries(dataStorageFactory, getIdx, cmp, areContinuous) ``` ###### Add some data