react-native-batch-push
react-native-batch-push copied to clipboard
Wrong builder implementation on BatchUserEditor
This is working, because each set* methods return a new BatchUserEditor and chaining is working.
BatchUser.editor()
.setAttribute(("age", 26)
.setDateAttribute("birthday", new Date('July 20, 69 00:20:18 GMT+00:00').getTime())
.save(); // ok
But if I use a variable on editor instance for each set* methods, builder is not working as expected (nothing saved):
const batchUserEditor = BatchUser.editor();
batchUserEditor.setAttribute(("age", 26)
batchUserEditor.setDateAttribute("birthday", new Date('July 20, 69 00:20:18 GMT+00:00').getTime())
batchUserEditor.save(); // nothing is saved
set* methods should mutate batchUserEditor variable to let save correct values.