About

Trigger was created as an alternative to state management systems that encourage using deeply nested objects for storing application state. This becomes particularly cumbersome when your application needs to READ from or WRITE to a relational database, which favor a flat structure. With Trigger you can maintain your application data in a similar structure as its source, which makes it easier to reason with data in your application. Benefits of using Trigger include:

  • keeping your data in a data-oriented flat structure (e.g., SoA) will make your application easier to develop as it grows in size and complexity
  • improved performance by only rendering components subscribing to specific tables/rows - no need to invalidate the entire store to make a small state change
  • the flexibility to store any object using the single data structure
  • triggers that facilitate side-effect interactions to localize logic
  • creating more than one store to localize state as needed
  • minimal changes to your existing code base - create your store, import it, and interact with it through regular React hooks

Core philosophies of Trigger

Trigger's core philosophies are:

  • Separation of data from code in your store
  • Preference for flat, basic structures that easily serialize
  • Relationships between data instead of embedding
  • Granular component updates instead of coarse updates
  • Simple integration with your store(s)
  • An enjoyable developer experience

When to use Trigger

Trigger is best suited for applications that interact with an underlying data source, or have complicated state requirements. The single data structure provides maximum flexibility (similar to existing state management libraries), while the table data structure provides an opinionated way to manage data as you would manage tables in a database or spreadsheet.

Built with in Halifax, Nova Scotia by JW