Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
nnikolash authored Sep 24, 2024
1 parent 43ee7d0 commit bc3fdd1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit bc3fdd1

Please sign in to comment.