Skip to content

Releases: Optimal-AI/redux-firestore

v0.16.0-beta.6

21 Apr 23:25
Compare
Choose a tag to compare
v0.16.0-beta.6 Pre-release
Pre-release

v0.16.0 - Turn on Immediate Mode for the UI

  • Cache Reducer. UI feels instantaneous to users.
    • Enables optimistic updates for new, deleted & updated data.
    • All data changes synchronously reflected in the redux state cache reducer queries.
    • Once Firestore approves/rejects a change it also removes the optimistic commit.
// selector for cache reducer
(state) => state.firebase.firestore.cache[myStoreAs].docs;

// access read-only fragment of Firestore based on all active queries
const document = state.firebase.firestore.cache.database[full_path_to_collection][document_id];
  • Mutate. Simplifies saving, batching and transactions.
    • Easily switch between single saves and atomic transactions.
    • Simplifies complex saves that have to coordinate through multiple actions.
    • Synchronously updates queries in the cache reducer for instance UI feedback for the app.
// single save
getFirestore().mutate({collection: 'tasks', doc: 'task-1', data: {status: 2}});
// batch
getFirestore().mutate([
  {collection: 'tasks', doc: 'task-1', data: {status: 2}},
  {collection: 'tasks', doc: 'task-2', data: {status: 2}},
]);
// transaction, read results use dependency injection for write functions.
getFirestore().mutate({
  reads: { task1: {collection: 'tasks', doc: 'task-1'} },
  writes: [ ({task1}) => ({collection: 'tasks', doc: task1.id, data: { status: task1.status +1 })) ]
});

v0.16.0-beta.3

15 Apr 22:34
Compare
Choose a tag to compare
v0.16.0-beta.3 Pre-release
Pre-release

v0.16.0 - Turn on Immediate Mode for the UI

  • Cache Reducer. UI feels instantaneous to users.
    • Enables optimistic updates for new, deleted & updated data.
    • All data changes synchronously reflected in the redux state cache reducer queries.
    • Once Firestore approves/rejects a change it also removes the optimistic commit.
// selector for cache reducer
(state) => state.firebase.firestore.cache[myStoreAs].docs;

// access read-only fragment of Firestore based on all active queries
const document = state.firebase.firestore.cache.database[full_path_to_collection][document_id];
  • Mutate. Simplifies saving, batching and transactions.
    • Easily switch between single saves and atomic transactions.
    • Simplifies complex saves that have to coordinate through multiple actions.
    • Synchronously updates queries in the cache reducer for instance UI feedback for the app.
// single save
getFirestore().mutate({collection: 'tasks', doc: 'task-1', data: {status: 2}});
// batch
getFirestore().mutate([
  {collection: 'tasks', doc: 'task-1', data: {status: 2}},
  {collection: 'tasks', doc: 'task-2', data: {status: 2}},
]);
// transaction, read results use dependency injection for write functions.
getFirestore().mutate({
  reads: { task1: {collection: 'tasks', doc: 'task-1'} },
  writes: [ ({task1}) => ({collection: 'tasks', doc: task1.id, data: { status: task1.status +1 })) ]
});

v0.16.0-beta.2

14 Apr 18:12
Compare
Choose a tag to compare
v0.16.0-beta.2 Pre-release
Pre-release

v0.16.0 - Turn on Immediate Mode for the UI

  • Cache Reducer. UI feels instantaneous to users.
    • Enables optimistic updates for new, deleted & updated data.
    • All data changes synchronously reflected in the redux state cache reducer queries.
    • Once Firestore approves/rejects a change it also removes the optimistic commit.
// selector for cache reducer
(state) => state.firebase.firestore.cache[myStoreAs].docs;

// access read-only fragment of Firestore based on all active queries
const document = state.firebase.firestore.cache.database[full_path_to_collection][document_id];
  • Mutate. Simplifies saving, batching and transactions.
    • Easily switch between single saves and atomic transactions.
    • Simplifies complex saves that have to coordinate through multiple actions.
    • Synchronously updates queries in the cache reducer for instance UI feedback for the app.
// single save
getFirestore().mutate({collection: 'tasks', doc: 'task-1', data: {status: 2}});
// batch
getFirestore().mutate([
  {collection: 'tasks', doc: 'task-1', data: {status: 2}},
  {collection: 'tasks', doc: 'task-2', data: {status: 2}},
]);
// transaction, read results use dependency injection for write functions.
getFirestore().mutate({
  reads: { task1: {collection: 'tasks', doc: 'task-1'} },
  writes: [ ({task1}) => ({collection: 'tasks', doc: task1.id, data: { status: task1.status +1 })) ]
});

v0.16.0-beta.1

11 Apr 17:02
fc21ce0
Compare
Choose a tag to compare
v0.16.0-beta.1 Pre-release
Pre-release

v0.16.0 - Turn on Immediate Mode for the UI

  • Cache Reducer. UI feels instantaneous to users.
    • Enables optimistic updates for new, deleted & updated data.
    • All data changes synchronously reflected in the redux state cache reducer queries.
    • Once Firestore approves/rejects a change it also removes the optimistic commit.
// selector for cache reducer
(state) => state.firebase.firestore.cache[myStoreAs].docs;

// access read-only fragment of Firestore based on all active queries
const document = state.firebase.firestore.cache.database[full_path_to_collection][document_id];
  • Mutate. Simplifies saving, batching and transactions.
    • Easily switch between single saves and atomic transactions.
    • Simplifies complex saves that have to coordinate through multiple actions.
    • Synchronously updates queries in the cache reducer for instance UI feedback for the app.
// single save
getFirestore().mutate({collection: 'tasks', doc: 'task-1', data: {status: 2}});
// batch
getFirestore().mutate([
  {collection: 'tasks', doc: 'task-1', data: {status: 2}},
  {collection: 'tasks', doc: 'task-2', data: {status: 2}},
]);
// transaction, read results use dependency injection for write functions.
getFirestore().mutate({
  reads: { task1: {collection: 'tasks', doc: 'task-1'} },
  writes: [ ({task1}) => ({collection: 'tasks', doc: task1.id, data: { status: task1.status +1 })) ]
});

v0.16.0-alpha

01 Apr 23:53
fc21ce0
Compare
Choose a tag to compare
v0.16.0-alpha Pre-release
Pre-release

Immediate mode.

  • Added new cache reducer. Provide synchronous read access to all data loaded from firestore. Optimistically reflects changes until resolved in Firestore.
  • Added new firestore.mutate api function to provide synchronous changes with eventual consistency.