kamranahmedse / redux-persist-expire

Expiring transformer for redux-persist
MIT License
78 stars 12 forks source link

Removed moment instead use plain Date functions #8

Closed sandinosaso closed 5 years ago

sandinosaso commented 5 years ago

As stated here: https://github.com/kamranahmedse/redux-persist-expire/issues/2 The library is heavy in size (around 248 kb) due to the moment of library dependency.

This PR removes the moment dependency and instead uses native Date functions.

What do you think about this approach? any downsides of having plain Date functions? I think the moment is great but for the use that is done for this package (simple calculations) is not worth the bundle size.

Some folks pointed to use https://date-fns.org/ instead of moment, for sure this will decrease the size, but not sure if needed anyway.

Here are the tests passing:

Screen Shot 2019-05-21 at 1 36 01 PM
sandinosaso commented 5 years ago

@kamranahmedse what do you think about this?

kamranahmedse commented 5 years ago

Thanks @sandinosaso, looks good! I will review and merge it this weekend.