Closed whatisboom closed 6 years ago
@whatisboom Thanks for your interest and this PR. Personally I prefer to go with functions but this isn't so important as the fact that I can enforce returned object to be of Storage
type. Not everyone are using TypeScript so I would like to keep inMemoryStorage
in the closure.
Would be so kind and make such PR adding length but keeping storageFactory
a function?
@MichalZalecki how do you feel about this solution? usage stays the same, and uses the class under the hood. If this isn't acceptable I can work on a solution with just functions and objects
Decided to tackle this. I converted to a class which would update the usage a tiny bit, but makes the length implementation much easier. I could add a wrapper function around the new class if you'd like to maintain usage consistency.