-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
serializing bigint #31
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good work @robmanganelly. I've left some comments.
@@ -1,14 +1,16 @@ | |||
import { getState, patchState, signalStore, withState } from '@ngrx/signals'; | |||
import { withStorageSync } from './with-storage-sync'; | |||
import { withBigIntRehydration, withBigIntReplacement, withStorageSync } from './with-storage-sync'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be possible to rename withBigIntRehydration
and withBigIntReplacement
to serialize
and deserialize
. I think bigint
will not be the last type where we require custom code.
import { TestBed } from '@angular/core/testing'; | ||
|
||
interface StateObject { | ||
foo: string; | ||
age: number; | ||
big: bigint; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be possible, that we leave the tests as they are and just create a separate test which checks the de/serialization for bigint
?
package-lock.json
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think that the package-lock.json
should be changed, right?
@@ -58,15 +104,20 @@ export type SyncConfig<State> = { | |||
/** | |||
* Function used to parse the state coming from storage. | |||
* | |||
* `JSON.parse()` by default | |||
* ~~`JSON.parse()` by default~~ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, you can replace that with parse
and stringify
(below).
Sorry for the late reply. Yes. I will take care of it. Thanks for the
comments.
|
@robmanganelly if you don't have the time, no worries. We'll merge and I can do the changes myself. Just let me know, cheers! |
Honestly, I don't want to pass the workload onto you guys. I'm really happy
to contribute to this project, even if my contributions are minuscule, but
I currently don't have the bandwidth, sadly, for which I apologize.
I can reach out once I'm done with my current tasks, and if changes are
still needed, I'll be more than happy to handle them myself.
Otherwise, please proceed as you see fit.
|
Content of this PR:
Considerations.