I'm creating a drag and drop angular module that I hope to externalize and publish to npm. The library will essentially allow the user to define drag and drop areas and associate ngrx actions with them.
const DND_RULES: DndRule[] = [
new DndRule('area1', 'area2', MOVE_AREA1_TO_AREA2_ACTION.getAction),
new DndRule('area2', 'area1', COPY_AREA2_TO_AREA2_ACTION.getAction),
]
A provided service will then dispatch the action that results from the rule.
My issue is that I need to integrate this library with the consumer's store. Is there a way to provide the ngrx store via some static module method or link it to my store behind the scenes in some way? DndModule.provideStore(???)
I'm not sure what this would look like behind the scenes
You can look at how the router store is implemented, https://github.com/ngrx/router-store.
The person trying to use your store will have to do some configuration and import the necessary actions, that they want to use.
import { go, replace, search, show, back, forward } from '@ngrx/router-store';